Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you pull just the date from a DateTime column?

ODBC functions

How do you pull just the date from a DateTime column?

by  foxdev  Posted    (Edited  )
ODBC provides a function, Left, that can be used to pull just the date portion of a date-time value. Note that the result is a character expression.

For example, if a date of birth column contains the value "08-Jan-1962 12:00:00", the ODBC command:

[tt]select {fn left(dob, 10)} from MyTable[/tt]

will yield only "08-Jan-1962".

As with all ODBC scalar functions, be sure to use the curly braces {} in the appropriate places, as the ODBC driver looks for these to indicate the section that the driver should interpret.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top