[HCN] Bluechip stored SQL dare format

Shaun Nell shaunnell at hotmail.com
Thu Sep 10 14:04:02 CEST 2009


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: <http://ozdocit.org/pipermail/hcn/attachments/20090910/416e15ef/attachment.htm>


More information about the HCN mailing list