Question : Microsoft Access 2003 SQL Query - Changing the date format of existing text strings

Hi

I have record set that has been exported into the following date format:

Thu Mar 30 08:48:22 EST 2006
Thu Dec 28 15:07:11 EST 2006
Tue Jan 01 00:00:00 EST 1980

What query can I run that will change this format to the following format (from the above example)

30-MAR-2006
28-DEC-2006
01-JAN-1980

Please note that I cannot change the Data Type of this field to 'Date/Time' due to other data being there that isn't Date/Time

Thanks

Answer : Microsoft Access 2003 SQL Query - Changing the date format of existing text strings

Hello,
Suppose you have FD field with string type and need to format it:

SELECT FD, Format(CDate(Mid([FD],5,6) & Right([FD],5)),"dd-mmm-yyyy") AS BestFormat FROM TB;

-FA


Random Solutions  
 
programming4us programming4us