FORMATTING

S

simplymidori

Hello,

I'm trying to write out a sql statement to populate some data. One of the
field is a "SPOTDATETIME" Type DATE. My data does not include the time only
date. I do not have access to write in this DB. I was told when writing my
statement to use "TO_CHAR" in my statement to convert the date into
Date/Time. Can someone help or tell me this is not possible?

Thanks in advance.
 
J

Jerry Whittle

What kind of database are you hitting? TO_CHAR is an Oracle function, not
Access.

If you want to see the time component of a date field, try using the Format
function. In an Access query it would look like:

DateAndTime: Format(SPOTDATETIME, "GENERAL DATE")
 
S

simplymidori

Oracle. I finally used TO_DATE('08/12/07 00:00:00','MM/DD/RR HH24:MI:SS')
but no TIME.

Any suggestions?
 
J

Jerry Whittle

00:00:00 means no time therefore none will be shown. If you change it to
10:00:00, then it will show the time.

SELECT TO_DATE('08/12/07 10:00:00','MM/DD/RR HH24:MI:SS') FROM dual ;

Also this is an Access database forum. You'd have much better luck on an
Oracle forum. Just lucky for you that I'm multi-talented. ;-)
 
S

simplymidori

I changed the time. I still get data with just the date. My time is not
appearing beside the date as formatted below.
 
Top