Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report which month

Status
Not open for further replies.

ex34i

IS-IT--Management
Mar 31, 2003
10
US
How do I make it so that when I print a report I do it by the month that I want and not by all the months?
 
In the query, you will need to add a "criteria"

For example, in the month field in your query, insert [enter the month]

When you run the query or the report, it will give you a pop up box that will say "enter the month" ... whatever you enter will be the criteria that the report uses.

Hope that helps!

Fred
 
How many reports are you generating? The reason I ask, is that I have a databse that prints 5 different reports and although Freds' reply will work well, the month will be asked every time a report is run. Another way of doing this is to create a small table, in this example I will call it "selection", with a field, example "month". Now create a form based on this one table. Now inside the query, add this table and in the selection criteria have the month field from the selection table. Now when the query is run, then only where the month matches will the record be included. A side advantage is that if two months are required, then both can be entered into the table and both will be on the report.
But all credit the Fred above, as his tip is best for one or two reports or if you wish to print the same report several times for different months. [pc]

Graham
 
Well that works! Now how do I make it so that I can look between dates, like 03/04/03 to 04/07/03? I tried to use the AND statment but it did not work. I also tried using between and it did not work so I am stumped.
 
If you are looking for specific dates, then try this - assuming that your table has a date field. The selection database needs now to have two fields - start date and end date. The queries then have the selction criteria of &quot;>=[start date] and <=[end date]&quot; against your date field.

If you have used Fred's suggestion, then the selection criteria would be the same, but since there is no &quot;selection&quot; database, you would be asked for the start date and end date values when you run the report. [pc]

Graham
 
koresnordic is correct - you can also put &quot;between [start date] and [end date]&quot; that will work as well (again, assuming that you have a date field. I am not sure if you use a command button on a form to run your report, if you do, you could add two fields to the form and use those two date fields on the form as your input criteria for the dates you want.

If that is something you would want to pursue, let me know and we can help you with that.

Fred
 
One more question then I think I am done. When the prompt comes up is there a way so I don't have to type in the /- when I put in the date, a way to autoformat as I type in the date?
 
Is this strictly a montly report? If it is... You can add a field called &quot;Eff Month&quot; to your query and make it a monthly criteria. Lets say for example you date field is simply called &quot;mydate&quot;. In your query, in a new field, type the following:

Eff Month: Month([mydate]) ..... where &quot;mydate&quot; is the name of your date. In the criteria section you can put [enter the month]....also, get rid of your other date criteria... Now instead of entering the from and to date as in 1/1/03 and 1/31/03.. you just enter january.

One problem if you decide to go this route... you will also have to enter the year, otherwise you will get all januarys regardless of year.

I think the base way for you to go is to create a form. You can have a dropdown box with all the months and a field for the year you want.

Let me know if you want to go that route and we can walk you through it.

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top