Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Year function

Status
Not open for further replies.

monrosal

Programmer
Aug 22, 2000
42
0
0
US

Has anyone else had a problem using the Year function? I'm trying to do a Year(Now()), but it's giving me a weird year. Also when I try to get the 4 digit year using
Format(date, "MM/DD/YYYY"), it still gives me the 2 digit year with mm/dd/yy. Does anyone know how I can get the current 4 digit year? It should be simple, but it's driving me crazy.

Ramon
 
Try "mm/dd/yyyy" instead of "MM/DD/YYYY". Format without a format functions as STR and since it may not recognize your uppercase format it may be ignoring it.
 
Alernatively, forget the formatting and try this from the debug window:

? year(date())
2001
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top