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?
DateTime in SQL
- 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
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
Re: DateTime in SQL
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,
uDateTime := cValToChar( uData ) // uData ... data from SQL DateTime field
dDate := CTOD( uDateTime ) // Get a date
cTime := SUBSTR( uDateTime, 12,8 ) // Geta a time
Regards,
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: DateTime in SQL
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.
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
G. N. Rao.
Hyderabad, India