DateTime in SQL

DateTime in SQL

Postby paulrogers » Wed Dec 16, 2015 7: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?
paulrogers
 
Posts: 4
Joined: Tue Mar 18, 2014 10:53 am

Re: DateTime in SQL

Postby Enrico Maria Giordano » Wed Dec 16, 2015 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DateTime in SQL

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

Re: DateTime in SQL

Postby nageswaragunupudi » Wed Dec 16, 2015 9: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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests