Forum Discussion
Luuk_Hessing
May 18, 2021Copper Contributor
Formatting 2-digit year in MS Access. How?
I need a 2-digit year notation and a 2-digit month notation from a date field. Using the helppage of Ms Access the 2-digit month notation wasn't much of a problem after "mm" behind notation and usin...
- May 19, 2021Hello Gustav,
And that was the way to do it. The option you referred to, I didn't realize that it was existing. Thank you very much.
Regards from the Netherlands.
George_Hepworth
May 18, 2021Silver Contributor
Keeping in mind that what you are talking about is a FORMAT FOR DISPLAY PURPOSES, and not the actual DATE VALUE STORED, you can do this with a Format() expression wherever you need to DISPLAY that FORMATTED STRING.
Format(Month(Date), "mm") & "/" & Format(Year(Date),"yy")
or
Format(Month(Date), "mm") & "-" & Format(Year(Date),"yy")
Having done this, you are DISPLAYING a string, not a date, so beware of trying to use it for any further date logic.
Luuk_Hessing
May 18, 2021Copper Contributor
I was not aware how Access is storing its date/time. Thank you for this explication.
Please, also read my other reply.