ACC: Using Format() and Month() Returns Incorrect MonthID: Q106290
|
Moderate: Requires basic macro, coding, and interoperability skills.
If you use the Format() function on the result of a Month() function,
Microsoft Access returns an incorrect result.
The Month() function converts a date to an integer. The Format() function is expecting a date serial number as an argument, but instead receives an integer.
This behavior is by design.
The following sample function returns January instead of April:
=Format$(Month(#4/30/93#), "mmmm")
=Format(#4/30/93#,"mmmm")
=Choose(Month([datefield]),"January","February","March","April", _
"May","June","July","August","September","October","November", _
"December")
For information about syntax and usage of the Choose function, search the Help Index for "Choose function."
Keywords : ExrOthr
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: March 27, 1999