Hi all,
trying to format a date to YYYYMM so it can be used when it exports data to a excel sheet as part of the name, however i'm having problems getting formattting to use a date and format it the way I want, in this example YYYYMM. I tried it and its not working so I tried something not so unusual such as MM and using todays date it throws back 1/4/1900 in staead of just 05 which I was expecting.
The code I have is as follows:
dteYYYYMM = Format(Date, "mm")
dteYYYYMM is a date variable.
Can anyone see where I am going wrong ?
I am using Access 2003 SP2 on a XP Service Pack 2.
Thanks in advance,
Mitch....
OK, tried it using strings and it now seems to work.
trying to format a date to YYYYMM so it can be used when it exports data to a excel sheet as part of the name, however i'm having problems getting formattting to use a date and format it the way I want, in this example YYYYMM. I tried it and its not working so I tried something not so unusual such as MM and using todays date it throws back 1/4/1900 in staead of just 05 which I was expecting.
The code I have is as follows:
dteYYYYMM = Format(Date, "mm")
dteYYYYMM is a date variable.
Can anyone see where I am going wrong ?
I am using Access 2003 SP2 on a XP Service Pack 2.
Thanks in advance,
Mitch....
OK, tried it using strings and it now seems to work.
Last edited: