PDA

View Full Version : Solved: Format for Month



blitzn
10-05-2007, 12:54 PM
I don't get it. I have a table field - formatted as short date. In a query I call for Month([Date Field]) and I get the result (Example date field = "10/1/1999" returned is "10". However, then in a new query I use Format("10", "mmm") and returned is "Jan". In fact all number 2-12 are returned "Jan" and the Number "1" is consistently retured "Dec". GO figure?

I've double checked the formats and the table field is formatted with "short Date". All I'm trying to do is return the month, in text, (Ex. "Feb") from a date. So I first converted the short date using Month(), then went to Format()......I first tried Format(Month(),"mmm") to no avail. Any help is appreciated.

Oorang
10-05-2007, 01:35 PM
There are four month formats.
m = 1
mm = 01
mmm = Jan
mmmm = January

mbarron
10-05-2007, 08:04 PM
When you use format and a number, the number is interperted as the serial date. Today, for example (October 5, 2007), is day 39360.

To display the Oct, you don't need to determine the month, you only need the date:
format([date],"mmm")

blitzn
10-06-2007, 11:45 AM
Thanks all - it worked...and now my artist wife is happy that she has a database to catalog her artwork -and maybe I get served a great meal this weekend....