Obtaining Month from a Date Field

G

Guest

I have a query that I want to just pull the Month out of a specific date
field. The date is formatted as 3/31/2006 or 10/31/2006. Can anybody tell me
how I can get just the month out of this date so I can use it in year to date
reports.

Thanks!
 
G

Guest

Format([YourDateField],"m") gives the number of the month.
Format([YourDateField],"mm") gives a two digit number of the month.
Format([YourDateField],"mmm") gives a three letter abreviation of the
month.
Format([YourDateField],"mmmm") give the full spelling of the month.
 
G

Guest

Debug.Print Month(#10/31/2006#) = 10

Is your data in an actual Date field? I hope so because Access likes
MM/DD/YYYY best. If it's stored in a text field, you could have problems.
 
G

Guest

Thanks for the help this works like a charm. Thanks !!!!

KARL DEWEY said:
Format([YourDateField],"m") gives the number of the month.
Format([YourDateField],"mm") gives a two digit number of the month.
Format([YourDateField],"mmm") gives a three letter abreviation of the
month.
Format([YourDateField],"mmmm") give the full spelling of the month.

jrp444 said:
I have a query that I want to just pull the Month out of a specific date
field. The date is formatted as 3/31/2006 or 10/31/2006. Can anybody tell me
how I can get just the month out of this date so I can use it in year to date
reports.

Thanks!
 

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

Similar Threads


Top