Re: Milliseconds to SQL Server DateTime



Hi John,

John Herbster wrote:
"Jouni Aro" <jouni.aro@xxxxxxxxx> wrote
I have now adopted the 'float' way and casting the values to
datetime in select. I will need to instruct the users also to
cast

Jouni,

I presume, by "cast", that you mean convert from one binary
form to another

Yes, by using the CAST() function in the SQL select as suggested by Vitt.

the data, if they need to add their own queries to the data. ...

I hope that you are aware that the TDateTime float type cannot
accurately represent millisecond times. That type can be very
close, but not exact.

Thanks for the note. The data is actually inserted from TDateTime:s so the resolution is actually enough. With the DateTime field, I could not get better than 1 second resolution - and that was a real problem.

.



Relevant Pages

  • Re: Select mit IF
    ... > Cast as Datetime) as Einsatzdatum, ... > aeinsatz.pause) as PauMinuten, Cast as ... > AEINSATZ.BKNZARBZEIT as BerechKZ ...
    (microsoft.public.de.sqlserver)
  • Re: DateTime, variants and double
    ... SQL Server stores them as paired integers - see BOL ... The table has a field of type DateTime which for various reasons I ... SELECT CAST AS FLOAT) ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: IF Klausel
    ... > So habe folgenden Select erstellt: ... > Cast as Datetime) as Einsatzdatum, ...
    (microsoft.public.de.sqlserver)
  • Re: DateTime, variants and double
    ... The table has a field of type DateTime which for various reasons I ... SELECT CAST AS FLOAT) ... btw I'm using SQL Server 2000 and VC++ 6 ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • ATL OLEDB Consumer Templates, SQL CE
    ... I am receiving a string by doing: ... CString str = cmd.GetValue; for getting a string from column 1 ... I am not sure what kind of cast I have ... to do to access a "datetime" field. ...
    (microsoft.public.sqlserver.ce)