Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extract time from a datttime field

10 views
Skip to first unread message

Rick Lipkin

unread,
Jun 16, 2009, 1:28:27 PM6/16/09
to
To All

How would I extract the 'time' from a datetime SQL field .. I can not
change it to a string because dtoc() chops off the time ??

Thanks
Rick Lipkin

dlzc

unread,
Jun 16, 2009, 1:42:41 PM6/16/09
to
Dear Rick Lipkin:

On Jun 16, 10:28 am, Rick Lipkin <lipkinrm29...@yahoo.com> wrote:
>
> How would I extract the 'time' from a datetime
> SQL field .. I can not change it to a string
> because dtoc() chops off the time ??

Looks like TtoC() will return a system-formatted DateTime string (with
caveats).

Looks like TtoS() will return a DateTime string, with the system time
starting at byte number 9, 9+10 - hour, 11+12 = minute, balance =
seconds (including decimal portion if any).

From the online docs...

David A. Smith

Rick Lipkin

unread,
Jun 16, 2009, 1:49:46 PM6/16/09
to

David

Sorry for the dumb reply .. what LIb do I need to link ?? I am already
linking in Ct.lib ??

Rick

Rick Lipkin

unread,
Jun 16, 2009, 2:26:54 PM6/16/09
to
> Rick- Hide quoted text -
>
> - Show quoted text -

David

I got it .. thanks .. I can work with Ttoc() ..

Rick

Reinaldo

unread,
Jun 17, 2009, 9:22:01 AM6/17/09
to

You could also use the CONVERT or CAST SQL functions to extract just
the date from a timestamp field.

Reinaldo.

0 new messages