DateTime in SQL

Post Reply
paulrogers
Posts: 4
Joined: Tue Mar 18, 2014 10:53 am

DateTime in SQL

Post by paulrogers »

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?
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: DateTime in SQL

Post by Enrico Maria Giordano »

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
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: DateTime in SQL

Post by avista »

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,
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: DateTime in SQL

Post by nageswaragunupudi »

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
Post Reply