Format Date and Time

cameron.scrimgeour

Registered User.
Local time
Today, 01:35
Joined
May 7, 2009
Messages
21
Used to using Oracle so not sure how to do this in Access.

I need to change the format of a date and time from...

01/08/2009 12:00:00

to

01-Aug-2009 12:00:00

How can I do this?

Would usually use to_Date in Oracle, but think I need to use something like the following...

FORMAT(#01/08/2009 12:00:00#, 'dd-Mon-yyyy HH:MM:SS')

But this doesnt seem to work right as I get a data type mismatch error.

Help?
 
Try looking up the Format function in the Access help
In Access getting more of the same is simply adding on the letters
d
dd
ddd
dddd

m
mm
mmm
mmmm

Both go from 1 didget (8 for aug), 2 didget ( 08 ) to 3 char (Aug) to full (August)
Course d does it for days....

Good luck !
 
Slight syntax change required

From
Code:
FORMAT(#01/08/2009 12:00:00#, 'dd-Mon-yyyy HH:MM:SS')

To
Code:
Format(#01-08-2009 12:00:00#, "dd-mmm-yyyy hh:nn:ss")

Or

Code:
Format(AnyDate, "dd-mmm-yyyy hh:nn:ss")
Format(Now(), "dd-mmm-yyyy hh:nn:ss")
 

Users who are viewing this thread

Back
Top Bottom