Something Wierd with Format function on a Date Field

  • Thread starter Thread starter Don Garry
  • Start date Start date
D

Don Garry

I'm trying to produce a query that will generate a 3 digit month (e.g. Dec)
from a date field and can't figure out why Access keeps giving me the wrong
month ???

Here's what I have in the query:

Format((Month([paymentdate])),"mmm") and the date in payment date is
12/15/2004.

The results of the above formula = "Jan" ???

I must be doing fundamentally wrong here. Any clues ?
 
This is the correct result although probably not the one you want.
Month(12/15/2004) returns the number 12. The Format() function is expected a
date so 12 becomes 1/11/1900. Showing the mmm of this is Jan. I'm not sure
why you thought you needed to display the month of a month. Try:
Format([paymentdate],"mmm")
 
Thanks Duane, your formula works perfect......guess I'd gone a little brain
dead !

Duane Hookom said:
This is the correct result although probably not the one you want.
Month(12/15/2004) returns the number 12. The Format() function is expected
a date so 12 becomes 1/11/1900. Showing the mmm of this is Jan. I'm not
sure why you thought you needed to display the month of a month. Try:
Format([paymentdate],"mmm")
--
Duane Hookom
MS Access MVP
--

Don Garry said:
I'm trying to produce a query that will generate a 3 digit month (e.g.
Dec) from a date field and can't figure out why Access keeps giving me
the wrong month ???

Here's what I have in the query:

Format((Month([paymentdate])),"mmm") and the date in payment date is
12/15/2004.

The results of the above formula = "Jan" ???

I must be doing fundamentally wrong here. Any clues ?
 
Back
Top