Query to Extract Month from Date...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two choices of what to do, and I am not sure what the "people above
me" will want.

Choice 1: I would like to me a query that returns data in a column that
just contains the month. Now, what we currently have is a date field in the
table. Is there a way to make the query just return the month?

Choice 2: How can I group a report by month if all I have is date format?
I would need to report the entire date. I would also need to be able to
create a report that just shows one month or a smaller group of months than
the entire population.

THANKS FOR ALL YOUR HELP!
 
Use a calculated field in a query for either of your options.

To get the month from a date, you can use the Format function:

This returns the number of the month (1 - 12):
JustTheMonth: Format([DateFieldName], "m")

This returns the number of the month (01 - 12):
JustTheMonth: Format([DateFieldName], "mm")

This returns the three-letter abbreviation of the month (Jan - Dec):
JustTheMonth: Format([DateFieldName], "mmm")

This returns the full name of the month (January - December):
JustTheMonth: Format([DateFieldName], "mmmm")

You then can display and/or sort on any of the above options.
 
Back
Top