Queries

F

Frank

New to access, so here it goes. I have 4 queries that
pull data for 4 different quarters throughout the year. I
have these queries pull the data by the date (#1/1/04# And
#3/31/04#) is for First Quarter, etc.

Question 1 - Is there an easier way where I need to only
create one query to do all four quarter instead of making
4 separate?

Question 2 - How would I do it to where I the user asks
for a year and that years data is displayed. Right now, I
would have to go in each year and change the criteria for
each query I created. I want it where I do not have to do
that.

All help is appreciated.

Frank
 
C

Cheryl Fischer

You could use a single query with a parameter which asks your users to enter
a start date and end date. To do this, put the following in the Criteria:
row of your query, in the column which contains the date to be queried:

Between [Enter Start Date] and [Enter End Date]


hth,
 
F

Frank

I thought of that, but it doesn't seem like it will work
with what I want to do. I want the report to display all
4 quarters. If I use a parameter query, then I will be
prompted 4 to enter the date 4 seperate times. I want to
display all 4 quarters on a report, and prompt for the
year.

Thanks

Frank
-----Original Message-----
You could use a single query with a parameter which asks your users to enter
a start date and end date. To do this, put the following in the Criteria:
row of your query, in the column which contains the date to be queried:

Between [Enter Start Date] and [Enter End Date]


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


New to access, so here it goes. I have 4 queries that
pull data for 4 different quarters throughout the year. I
have these queries pull the data by the date (#1/1/04# And
#3/31/04#) is for First Quarter, etc.

Question 1 - Is there an easier way where I need to only
create one query to do all four quarter instead of making
4 separate?

Question 2 - How would I do it to where I the user asks
for a year and that years data is displayed. Right now, I
would have to go in each year and change the criteria for
each query I created. I want it where I do not have to do
that.

All help is appreciated.

Frank


.
 
C

Cheryl Fischer

Use the DatePart () function to determine the quarter:

DatePart("q", [MyDate])

Use the Year() function to determine the year to be selected:

Year([MyDate])

If you want your users to select based on a Year, then insert the above into
the Field: row of a query column and, in the Criteria: row, enter:

[Enter the desired year]

This, of course, will return records for a full year, while asking your
users to enter a beginning date and an ending date gives them the
flexibility to report on any period of time.


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Frank said:
I thought of that, but it doesn't seem like it will work
with what I want to do. I want the report to display all
4 quarters. If I use a parameter query, then I will be
prompted 4 to enter the date 4 seperate times. I want to
display all 4 quarters on a report, and prompt for the
year.

Thanks

Frank
-----Original Message-----
You could use a single query with a parameter which asks your users to enter
a start date and end date. To do this, put the following in the Criteria:
row of your query, in the column which contains the date to be queried:

Between [Enter Start Date] and [Enter End Date]


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


New to access, so here it goes. I have 4 queries that
pull data for 4 different quarters throughout the year. I
have these queries pull the data by the date (#1/1/04# And
#3/31/04#) is for First Quarter, etc.

Question 1 - Is there an easier way where I need to only
create one query to do all four quarter instead of making
4 separate?

Question 2 - How would I do it to where I the user asks
for a year and that years data is displayed. Right now, I
would have to go in each year and change the criteria for
each query I created. I want it where I do not have to do
that.

All help is appreciated.

Frank


.
 
F

Frank

That's what I'm looking for. Thank you!

-----Original Message-----
Use the DatePart () function to determine the quarter:

DatePart("q", [MyDate])

Use the Year() function to determine the year to be selected:

Year([MyDate])

If you want your users to select based on a Year, then insert the above into
the Field: row of a query column and, in the Criteria: row, enter:

[Enter the desired year]

This, of course, will return records for a full year, while asking your
users to enter a beginning date and an ending date gives them the
flexibility to report on any period of time.


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I thought of that, but it doesn't seem like it will work
with what I want to do. I want the report to display all
4 quarters. If I use a parameter query, then I will be
prompted 4 to enter the date 4 seperate times. I want to
display all 4 quarters on a report, and prompt for the
year.

Thanks

Frank
-----Original Message-----
You could use a single query with a parameter which
asks
your users to enter
a start date and end date. To do this, put the following in the Criteria:
row of your query, in the column which contains the
date
to be queried:
Between [Enter Start Date] and [Enter End Date]


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


New to access, so here it goes. I have 4 queries that
pull data for 4 different quarters throughout the year. I
have these queries pull the data by the date
(#1/1/04#
And
#3/31/04#) is for First Quarter, etc.

Question 1 - Is there an easier way where I need to only
create one query to do all four quarter instead of making
4 separate?

Question 2 - How would I do it to where I the user asks
for a year and that years data is displayed. Right now, I
would have to go in each year and change the criteria for
each query I created. I want it where I do not have
to
do
that.

All help is appreciated.

Frank


.


.
 

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

Top