FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO Datetime field
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
ADO Datetime field
Posted: Wed Jun 20, 2007 08:09 PM

To All

How do I concantonate date()+time() into a datetime field to SQL server with ADO ??

The reason to add the time stamp is because SQl server does not respect 'natural order'. When I have multiple entry's on the same date() .. SQL will order them randomly within the same date and not as they were added to the table by date .. however if I add the Time() aspect to the datetime field .. the records sort in order of actual sequence.

Rick Lipkin
SC Dept of Health, USA

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
ADO Datetime field
Posted: Fri Jun 22, 2007 02:55 AM
Convert date and seconds into a double value like this and assign the value. Date field in OLE can be assigned a value as date or double

nDateTime := ( dDate - CTOD("")) + (nSeconds/(24*3600))
oRs:Fields("datetimefield"):Value := nDateTime


This works for all OLE applns, with win32ole.prg of xHarbour. Thiis is working me for Excel and Oracle. Should work for MSSql also.

Regards
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion