Each month for a query

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

Guest

I have a database with month,day,year. I want to run a query using only one
month at a time. for example, November month. What do I put in my criteria?
 
Your question implies that you have a separate field in which you store the
Month, day, and year. Assuming this is correct, under the "month" field you
would put your criteria as...

=11


Note that "month" and "year" are reserved words (I think "day" may also be).
Hopefully you have not named your fields using these reserved words.

Rick B



Melissa needing help!! said:
I have a database with month,day,year. I want to run a query using only one
month at a time. for example, November month. What do I put in my
criteria?
 
I'm sorry I didn't explain myself very well, I'm new to this. Anyways, I
have a date field, with the mm,dd,yyyy, I want to do a report using each
month separately, but first I must do a query using each month individually.
What would I put into my critical? Thanks so much.
 
How about ....
Where date field >=#11/01/2005# and date_field <=#11/30/2005#

You might like to take a look at the datediff function.

Madhouse
 
If you are going to run a report for each month, I would not break them into
separate queries/reports, I would simply use my sorting and grouping option
on my report to break the page when the month changes. I'd include a "page
header" that was actually my report header.

This is if you want to print all the records but, break them by month.

If you want to run it for a specifc month, then add a new column to your
query to pull the month out of your date...

MonthSold: Datepart("mm",[SomeDateField]

Then in the criteria under that column, put a prompt to allow the user to
make an entry...

=[EnterMonth ##]




Hope that helps.

Rick B
 
Just so you know, you state that you "have a date field, with the
mm,dd,yyyy". The format being displayed is not important. Access does not
store the date as you list, it stores it (including the time) as a number
representing a specific point in time.

How that date displays can be manipulateed by you in your queries, reports,
and forms without affecting what is stored in the table.

Rick B
 
Thanks

madhouse said:
How about ....
Where date field >=#11/01/2005# and date_field <=#11/30/2005#

You might like to take a look at the datediff function.

Madhouse
 
It does thank you very much.

Rick B said:
If you are going to run a report for each month, I would not break them into
separate queries/reports, I would simply use my sorting and grouping option
on my report to break the page when the month changes. I'd include a "page
header" that was actually my report header.

This is if you want to print all the records but, break them by month.

If you want to run it for a specifc month, then add a new column to your
query to pull the month out of your date...

MonthSold: Datepart("mm",[SomeDateField]

Then in the criteria under that column, put a prompt to allow the user to
make an entry...

=[EnterMonth ##]




Hope that helps.

Rick B



Melissa needing help!! said:
I'm sorry I didn't explain myself very well, I'm new to this. Anyways, I
have a date field, with the mm,dd,yyyy, I want to do a report using each
month separately, but first I must do a query using each month individually.
What would I put into my critical? Thanks so much.
 
Back
Top