Date from dd/mm/yyyy to dd-mmm-yyy

IanMilly

Registered User.
Local time
Today, 21:51
Joined
Jun 1, 2004
Messages
46
Hi,

I have got a date created as a string (date)

the output format of my code in VBA is dd/mm/yy ie 01/02/2004

I want to be able to get this into a dd/mmm/yyyy format ie 01-feb-2004

how can i do this?

I know i can extract the month using month(date), how can i have this in a aphabetical format and not numeric?

Sorry if this is v easy

Thanks

Ian
 
Lookup the Format() function.
 
Sorry if this is v easy
Indeed, just try the format function....

Greetz & GL
 
sorry, got it now,

I had tried the format function but didn't apply it properly. I missed the " around mmm and so nothing was formatted.


for anyone else who does a **** up like this:

now sDateInAlphabetical = format (MyDateValue, "mmm")
-if the MyDateValue is a value 1-12, the equivalent month is returned.

thanks
 
why dont you use it like so??

sDateInAlphabetical = format (MyDateValue, "dd-mmm-yyyy")

where MyDateValue is any valid date!

Greetz
 
all i required at the time was the month,

i have used this dd-mmm-yyyy format also elsewhere. thought of that for some other part of my prog after writing the thread - just thought it was obvious
 

Users who are viewing this thread

Back
Top Bottom