DatePart("y",SomeDate) returns the number of the day in the year
DatePart("yyyy",SomeDate) returns the year
DatePart("yyyy",SomeDate) mod 100 will strip off the century
so
DatePart("yyyy",SomeDate)\100 will return the century
so
(DatePart("yyyy",SomeDate)\100) - 19 will return 0 for the 20th century
and 1 for the 21st century.
Combine all that and make sure things are type cast correctly.
?(CLng((DatePart("yyyy",SomeDate)\100)-19) * 100000)
+(CLng((DatePart("yyyy",SomeDate)) mod 100)* 1000) +DatePart("y",SomeDate)
And your probably don't need the Clng to force the type casting
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================