Extracting Month From Date

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
A

Anthony Viscomi

Yes, its me again! I have a Query that has a date field (MM/DD/YYYY). I am
trying to sum the total # of units sold and group them by Month. The closest
that I get get are daily totals. I assume that there is a function that'll
"break-out" the Month portion of a date.
Can someone please give me a hint?

Anthony
 
The Month() function should do that for you. Try Grouping your query by
Year([MyDateField]) and Month([MyDateField])


hth,
 
Yes, its me again! I have a Query that has a date field (MM/DD/YYYY). I am
trying to sum the total # of units sold and group them by Month. The closest
that I get get are daily totals. I assume that there is a function that'll
"break-out" the Month portion of a date.
Can someone please give me a hint?

Anthony

You'll hate this...

Month([datefield])

returns a number 1 to 12.
 
Yes... the Month function is the way to go if it is truly
a date field. If, perhaps, it is a text field that looks
like a date - try a new field using Left([text date],2)
to string off the first two characters of the text.
 
Since you frequently may freqently cross years, I like to
use the formula Period:dateserial(year([datefield]),month
([datefield]),1).
 
Back
Top