PDA

View Full Version : Change text to a date format



evlai
11-19-2007, 02:03 AM
I have a column with Text property, I would like to change the date to the date format. How do I do it?

Sample Data:
11/12/2006
1/25/2005
1/1/2007

I tried to test on dateserial(left([MyDate],2),mid([Mydate],3,2),right([Mydate],4))

But this does not work...anyone can help?

mattj
11-19-2007, 10:44 AM
The arguments for the dateserial function are year, month, day. You have reversed them.

However, since you already have the data in the correct sequence and with the slashes, I would use the CDate function instead...

HTH
Matt

TonyJollans
11-19-2007, 11:16 AM
If you're American you should be able to use CDate - if not, you may not get the expected result for, say 11/12/2006.