By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Multiple Queries - 1 date range

P: n/a
Hi All,

This may be a really obvious thing that I'm missing ... but if anyone can
help, I'd appreciate it.

I have MS Access 2000:

I'm using it for a CRM type database. I have a table with names, date they
first became a customer, and about 3 fields of addional info.
I.e.
What was the source of the business (source)
What was the advertising they saw to find us (Advert)
Type of customer (type) "Home" or "Commercial"
I have a number of queries I want to run via a date range
E.g. Q1, Q2, Q3. All to be run with paramaters of 31/5/2004 to 1/7/2004
(to encomapss all of June 2004 data).

Is there a way I can have a marco run to run the queries in turn, (I can
append their outpot to a table), - that I only have to input the date
ranges the once? As opposed to for EACH query?

Thanks in advance for anyone who knows how to do this.

P.s. What I know about VBA programming can be stored in a matchbox, without
removing any of the matches.

Thanks again.

Adam
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Adam <re*@apd1.net> wrote in message news:<Xn************************@203.59.27.131>...
Hi All,

This may be a really obvious thing that I'm missing ... but if anyone can
help, I'd appreciate it.

I have MS Access 2000:

I'm using it for a CRM type database. I have a table with names, date they
first became a customer, and about 3 fields of addional info.
I.e.
What was the source of the business (source)
What was the advertising they saw to find us (Advert)
Type of customer (type) "Home" or "Commercial"
I have a number of queries I want to run via a date range
E.g. Q1, Q2, Q3. All to be run with paramaters of 31/5/2004 to 1/7/2004
(to encomapss all of June 2004 data).

Is there a way I can have a marco run to run the queries in turn, (I can
append their outpot to a table), - that I only have to input the date
ranges the once? As opposed to for EACH query?

Thanks in advance for anyone who knows how to do this.

P.s. What I know about VBA programming can be stored in a matchbox, without
removing any of the matches.

Thanks again.

Adam


The easiest way to do this is to use an unbound form to collect the
dates. Create a new form with no recordsource (so you won't pick a
table/query when the wizard prompts - you'll just go on to the next
step). Then drop two textboxes onto your form, set their format as
date. Then name them something useful. txtStartDate and txtEndDate.

Then in your query, just point the parameters to your open form.
....WHERE SomeDate BETWEEN [Forms]![MyForm]![txtStartDate] AND
[Forms]![MyForm]![txtEndDate]
Nov 13 '05 #2

P: n/a
Pieter,

Thanks for the answer - Exactly what I needed to know.

Cheers,

Adam

pi********@hotmail.com (Pieter Linden) wrote in
news:bf**************************@posting.google.c om:
Adam <re*@apd1.net> wrote in message
news:<Xn************************@203.59.27.131>...
Hi All,

This may be a really obvious thing that I'm missing ... but if anyone
can help, I'd appreciate it.

I have MS Access 2000:

I'm using it for a CRM type database. I have a table with names,
date they first became a customer, and about 3 fields of addional
info. I.e.
What was the source of the business (source)
What was the advertising they saw to find us (Advert)
Type of customer (type) "Home" or "Commercial"
I have a number of queries I want to run via a date range
E.g. Q1, Q2, Q3. All to be run with paramaters of 31/5/2004 to
1/7/2004 (to encomapss all of June 2004 data).

Is there a way I can have a marco run to run the queries in turn, (I
can append their outpot to a table), - that I only have to input the
date ranges the once? As opposed to for EACH query?

Thanks in advance for anyone who knows how to do this.

P.s. What I know about VBA programming can be stored in a matchbox,
without removing any of the matches.

Thanks again.

Adam


The easiest way to do this is to use an unbound form to collect the
dates. Create a new form with no recordsource (so you won't pick a
table/query when the wizard prompts - you'll just go on to the next
step). Then drop two textboxes onto your form, set their format as
date. Then name them something useful. txtStartDate and txtEndDate.

Then in your query, just point the parameters to your open form.
...WHERE SomeDate BETWEEN [Forms]![MyForm]![txtStartDate] AND
[Forms]![MyForm]![txtEndDate]


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.