This is the query that I have, which is months in two digits.
My goal is finding the right criteria to retrieve one month ago from today or this month, in two digits.
Currently
Month(now())
gives 10, but I hope to get 09, not 9.
I tried DateSerial, getDate(), pretty anything I could think of or online. But none of them worked. Any advice on this would be highly appreciated! Thank you!
You can use the following:
Format(DateAdd("m", -1, Now()), "MM")
The DateAdd
part substracts the current date by one month, the Format
part outputs the month in the MM
format (with leading zero)