Click to See Complete Forum and Search --> : MS Access Parsing Date


canton
January 24th, 2006, 10:49 AM
Hi,

I have field in an Access database whose datatype is text.

It contains various dates, some of which are in Y-MM-DD (e.g. 20011231), while the rest are only in Year format (e.g. 1999).

How can I modify this field so that the dates in Year format (such as 1999) are converted to Year(as specified in field)Jan1 (e.g. 19990101). So that the format for the field is either Y-MM-DD or some numeric format (such as double)

Thanks,

womalley
February 7th, 2006, 02:07 PM
maybe this site can help ya out

MS ACCESS (http://www.mvps.org/access/search.htm)

Rich2189
February 8th, 2006, 01:28 PM
try



SERIAL = format(date, "general number")



This will convert a date into a date serial, date number 1 is january the 1st 1989 (i think) and they have been numbered like that ever since. Today we are on something like 36000.


then to get the date back



cDate(serial)



Rich