[HCN] Bluechip stored SQL dare format

Peter Machell peter at mobilecomputing.net.au
Thu Sep 10 09:18:18 CEST 2009


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



More information about the HCN mailing list