FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DateTime in SQL
Posts: 4
Joined: Tue Mar 18, 2014 10:53 AM
DateTime in SQL
Posted: Wed Dec 16, 2015 07:51 AM

Hi All,

I know that I am doing something wrong, but I am looking for a way of getting the time from a SQL DateTime field?

if I do a plain Xbrowse on the DataTable, I am still seeing the value in the Table as a Date Only

the TTOC / TTOS function only seem to return the Date portion of the field and nothing from the STRING. Is this a "latest version" issue, or is their something more fundamental going on?

I have noticed that the FWH directory is from 2011, but I am unsure as to how to qualify which version of FWH I am using?

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DateTime in SQL
Posted: Wed Dec 16, 2015 09:37 AM
paulrogers wrote:I have noticed that the FWH directory is from 2011, but I am unsure as to how to qualify which version of FWH I am using?


Look inside include\fivewin.ch.

EMG
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: DateTime in SQL
Posted: Wed Dec 16, 2015 10:38 AM

You can try this

uDateTime := cValToChar( uData ) // uData ... data from SQL DateTime field
dDate := CTOD( uDateTime ) // Get a date
cTime := SUBSTR( uDateTime, 12,8 ) // Geta a time

Regards,

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DateTime in SQL
Posted: Wed Dec 16, 2015 09:42 PM

If you are using ADO you can read both date and time together. I am not sure the library you are using truncates the value to date only.

XBrowse, while browsing ADO recordsets, by default displays date portion only. We need to specify oCol:cDataType := 'T' or oCol:cEditPicture := "@T" to display full date and time.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion