Extracting Month From 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
 
C

Cheryl Fischer

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


hth,
 
J

John Vinson

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.
 
P

Pat

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.
 
M

Mark

Since you frequently may freqently cross years, I like to
use the formula Period:dateserial(year([datefield]),month
([datefield]),1).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top