i written a code in vb for finding the last month. but i didn’t get the output which i am expecting.
here is my code:
a=Format$(Now, "mm")-1
but i want output in 2 digit like if last month is Jan then output should be 01 not only 1
please help me out.
Use the DateAdd function. More specifically: