From shaunnell at hotmail.com Thu Sep 10 09:04:07 2009 From: shaunnell at hotmail.com (Shaun Nell) Date: Thu, 10 Sep 2009 17:04:07 +1000 Subject: [HCN] Bluechip stored SQL dare format Message-ID: Hi, A client as asked me check the possibility of writing some reports using their Bluechip SQL database. It looks basic enough except Bluechip stores the date as an int type rather than datetime. Does anyone know how to convert this int to a proper date/time format? At a guess I think it is the days since 0 AD. Thanks Shaun -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at mobilecomputing.net.au Thu Sep 10 09:18:18 2009 From: peter at mobilecomputing.net.au (Peter Machell) Date: Thu, 10 Sep 2009 17:18:18 +1000 Subject: [HCN] Bluechip stored SQL dare format In-Reply-To: References: Message-ID: On 10/09/2009, at 5:04 PM, Shaun Nell wrote: > Hi, > A client as asked me check the possibility of writing some reports > using their Bluechip SQL database. It looks basic enough except > Bluechip stores the date as an int type rather than datetime. Does > anyone know how to convert this int to a proper date/time format? > At a guess I think it is the days since 0 AD. Sure do, assuming it's the same MSSQL datetime as Pracsoft: "DECLARE @Date DATETIME; SET @Date = FLOOR(CONVERT(FLOAT, GETDATE())); SELECT APPT.[When] BETWEEN @Date AND (@DATE + x)" ORDER BY APPT.[When]" I think I've simplified that code enough for you to work out what is going on. Obviously @DATE is always now. The APPT.[When] brackets are because you really shouldn't use an SQL modifier as a table name, but someone over there didn't get that memo. regards, Peter. -- Peter Machell Systems Administrator mobilecomputing.net.au (07) 3839 4321 From peter at mobilecomputing.net.au Thu Sep 10 09:20:22 2009 From: peter at mobilecomputing.net.au (Peter Machell) Date: Thu, 10 Sep 2009 17:20:22 +1000 Subject: [HCN] Bluechip stored SQL dare format In-Reply-To: References: Message-ID: <31EF6B34-D225-4FD8-82B5-94E5AE85D354@mobilecomputing.net.au> On 10/09/2009, at 5:18 PM, Peter Machell wrote: > On 10/09/2009, at 5:04 PM, Shaun Nell wrote: > >> Hi, >> A client as asked me check the possibility of writing some reports >> using their Bluechip SQL database. It looks basic enough except >> Bluechip stores the date as an int type rather than datetime. Does >> anyone know how to convert this int to a proper date/time format? >> At a guess I think it is the days since 0 AD. > > > Sure do, assuming it's the same MSSQL datetime as Pracsoft: > > "DECLARE @Date DATETIME; SET @Date = FLOOR(CONVERT(FLOAT, GETDATE())); > SELECT APPT.[When] BETWEEN @Date > AND (@DATE + x)" > ORDER BY APPT.[When]" > > > I think I've simplified that code enough for you to work out what is > going on. Obviously @DATE is always now. The APPT.[When] brackets > are because you really shouldn't use an SQL modifier as a table name [CORRECTION Column name] > , but someone over there didn't get that memo. > > regards, > Peter. > > -- > Peter Machell > Systems Administrator > mobilecomputing.net.au > (07) 3839 4321 > > _______________________________________________ > HCN mailing list > HCN at ozdocit.org > http://ozdocit.org/cgi-bin/mailman/listinfo/hcn -- Peter Machell Systems Administrator mobilecomputing.net.au (07) 3839 4321 From peallen at tpg.com.au Thu Sep 10 10:53:00 2009 From: peallen at tpg.com.au (Peter) Date: Thu, 10 Sep 2009 18:53:00 +1000 Subject: [HCN] Bluechip stored SQL dare format References: <31EF6B34-D225-4FD8-82B5-94E5AE85D354@mobilecomputing.net.au> Message-ID: as usual Peter...very informative... as an apprentice nerd I have no idea what this means but I am sure that it will be of use up the road.... regards Peter Allen ----- Original Message ----- From: "Peter Machell" To: "Unmoderated discussion for HCN software, including Medical Director,Pracsoft and Bluechip" Sent: Thursday, September 10, 2009 5:20 PM Subject: Re: [HCN] Bluechip stored SQL dare format > > On 10/09/2009, at 5:18 PM, Peter Machell wrote: > >> On 10/09/2009, at 5:04 PM, Shaun Nell wrote: >> >>> Hi, >>> A client as asked me check the possibility of writing some reports >>> using their Bluechip SQL database. It looks basic enough except >>> Bluechip stores the date as an int type rather than datetime. Does >>> anyone know how to convert this int to a proper date/time format? >>> At a guess I think it is the days since 0 AD. >> >> >> Sure do, assuming it's the same MSSQL datetime as Pracsoft: >> >> "DECLARE @Date DATETIME; SET @Date = FLOOR(CONVERT(FLOAT, GETDATE())); >> SELECT APPT.[When] BETWEEN @Date >> AND (@DATE + x)" >> ORDER BY APPT.[When]" >> >> >> I think I've simplified that code enough for you to work out what is >> going on. Obviously @DATE is always now. The APPT.[When] brackets >> are because you really shouldn't use an SQL modifier as a table name > > [CORRECTION Column name] > >> , but someone over there didn't get that memo. >> >> regards, >> Peter. >> >> -- >> Peter Machell >> Systems Administrator >> mobilecomputing.net.au >> (07) 3839 4321 >> >> _______________________________________________ >> HCN mailing list >> HCN at ozdocit.org >> http://ozdocit.org/cgi-bin/mailman/listinfo/hcn > > -- > Peter Machell > Systems Administrator > mobilecomputing.net.au > (07) 3839 4321 > > _______________________________________________ > HCN mailing list > HCN at ozdocit.org > http://ozdocit.org/cgi-bin/mailman/listinfo/hcn > > -------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database: 270.13.88/2357 - Release Date: 09/09/09 17:50:00 From shaunnell at hotmail.com Thu Sep 10 14:04:02 2009 From: shaunnell at hotmail.com (Shaun Nell) Date: Thu, 10 Sep 2009 22:04:02 +1000 Subject: [HCN] Bluechip stored SQL dare format In-Reply-To: References: Message-ID: Thanks Peter! You definitely gave me enough to see the light. Thanks. Shaun -----Original Message----- From: hcn-bounces at ozdocit.org [mailto:hcn-bounces at ozdocit.org] On Behalf Of Peter Machell Sent: Thursday, 10 September 2009 5:18 PM To: Unmoderated discussion for HCN software, including Medical Director,Pracsoft and Bluechip Subject: Re: [HCN] Bluechip stored SQL dare format On 10/09/2009, at 5:04 PM, Shaun Nell wrote: > Hi, > A client as asked me check the possibility of writing some reports > using their Bluechip SQL database. It looks basic enough except > Bluechip stores the date as an int type rather than datetime. Does > anyone know how to convert this int to a proper date/time format? > At a guess I think it is the days since 0 AD. Sure do, assuming it's the same MSSQL datetime as Pracsoft: "DECLARE @Date DATETIME; SET @Date = FLOOR(CONVERT(FLOAT, GETDATE())); SELECT APPT.[When] BETWEEN @Date AND (@DATE + x)" ORDER BY APPT.[When]" I think I've simplified that code enough for you to work out what is going on. Obviously @DATE is always now. The APPT.[When] brackets are because you really shouldn't use an SQL modifier as a table name, but someone over there didn't get that memo. regards, Peter. -- Peter Machell Systems Administrator mobilecomputing.net.au (07) 3839 4321 _______________________________________________ HCN mailing list HCN at ozdocit.org http://ozdocit.org/cgi-bin/mailman/listinfo/hcn -------------- next part -------------- An HTML attachment was scrubbed... URL: