Filtering Report by Month? - Access 2002

K

kdagostino

I have a database of appointments with all the contact info and such. I have
created a report that lists these appointments in chronological order by day
and hour. However, it lists all appointments in the database.

The Date/Time field is all in one in the General Date format

Is there a way I can filter it so that it prints out only the month I want?
 
D

Douglas J Steele

Do you want everything for a given month, or everything for a given month
and year?

In either case, make sure your report is based on a query, not the table
itself.

For month only, add a computed field to your query that returns the month.
To do this, type something like the following into a blank cell on the Field
row in the design grid:

ApptMonth: Month(AppointmentDate)

(replace AppointmentDate by the name of your actual field)

In the Criteria row underneath what you type above, put [What Month?]

When you run the query (or the report that's based on that query), you'll be
presented with an input box, with What Month? as the prompt. Type in the
month number (1 through 12), and only appointments for that month will be
returned.

If you want month and year, add a second computed field

ApptYear: Year(AppointmentDate)

with criteria [What Year?]

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


kdagostino said:
I have a database of appointments with all the contact info and such. I have
created a report that lists these appointments in chronological order by day
and hour. However, it lists all appointments in the database.

The Date/Time field is all in one in the General Date format

Is there a way I can filter it so that it prints out only the month I
want?
 
T

Tom Coffinger

build the report on a query
open the report in design view
open the report properties
click on the data tab
click in the record source field
click the ellipse ( ...) at the right end of the field
you will be prompted about making a query, answer yes
include all needed fields

in the date field of the query put this in the criteria line

between [start] and [end]

close and save

Now when you run the report, you will prompted for a beginning date and end
date, so the report is now 'dynamic'.

The text inside the brackets is what will appear on the prompt, and you can
replace the words start and end with any words not already used in the
query.
you can also reference these two new fields on the report so you know what
dates where used. To do this

place a textbox on the report make it's data source ="This report is for the
period starting " & [start] & " and ending " & [end] & "."

note the spaces inside the qoutes.

kdagostino said:
I have a database of appointments with all the contact info and such. I have
created a report that lists these appointments in chronological order by day
and hour. However, it lists all appointments in the database.

The Date/Time field is all in one in the General Date format

Is there a way I can filter it so that it prints out only the month I
want?
 
K

kdagostino

Thank You. That worked perfectly.

Douglas J Steele said:
Do you want everything for a given month, or everything for a given month
and year?

In either case, make sure your report is based on a query, not the table
itself.

For month only, add a computed field to your query that returns the month.
To do this, type something like the following into a blank cell on the Field
row in the design grid:

ApptMonth: Month(AppointmentDate)

(replace AppointmentDate by the name of your actual field)

In the Criteria row underneath what you type above, put [What Month?]

When you run the query (or the report that's based on that query), you'll be
presented with an input box, with What Month? as the prompt. Type in the
month number (1 through 12), and only appointments for that month will be
returned.

If you want month and year, add a second computed field

ApptYear: Year(AppointmentDate)

with criteria [What Year?]

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


kdagostino said:
I have a database of appointments with all the contact info and such. I have
created a report that lists these appointments in chronological order by day
and hour. However, it lists all appointments in the database.

The Date/Time field is all in one in the General Date format

Is there a way I can filter it so that it prints out only the month I
want?
 
Top