473,748 Members | 6,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Queries - 1 date range

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
2 2814
Adam <re*@apd1.net > wrote in message news:<Xn******* *************** **@203.59.27.13 1>...
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
Pieter,

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

Cheers,

Adam

pi********@hotm ail.com (Pieter Linden) wrote in
news:bf******** *************** ***@posting.goo gle.com:
Adam <re*@apd1.net > wrote in message
news:<Xn******* *************** **@203.59.27.13 1>...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6090
by: BlackFireNova | last post by:
Using Access 2002 I am writing a report which draws data from several different tables. I can't link all the tables in a query, as some can not be related without truncating the data. I plan to use sub-queries and sub-reports to filter and display the data in the unrelated tables in my report. The common information is a user-inputed date range. I want to avoid having the user prompted for the and variables repeatedly. Somehow I...
12
6390
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date ranges, ie between 24/09/2004 and 01/10/2004 together with 05/10/2004 and 07/10/2004 ? If I enter the "Between" criteria on different lines it returns no data.
6
4996
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
7
3391
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always either AND or OR but never mixed together. We can use Northwind database for my question, it is very similar to the structure of the problem on the database I am working on. IF(SELECT OBJECT_ID('REPORT')) IS NOT NULL DROP TABLE REPORT_SELECTION
2
13555
by: chrisale | last post by:
Hi All, I've been racking my brain trying to figure out some sort of Sub-Select mySQL statement that will create a result with multiple rows of averaged values over a years time. What I have is weather data. There is a new record every 5 minutes, every day. So. What I want to do with one SQL statement is figure out the Average of those 5 minute records over each day, for every day of the year.
1
2283
Altius
by: Altius | last post by:
Access Version: 2003 OS: XP Pro Sorry if this is a bit long winded. First a little info about the database. This database is used to keep track of checkout information from our production department. It has three main tables that store information, the first one, that I have named "Checkout", stores the information I am querying for the two reports. It has six different fields - OrderNumber, Date, CheckedBy, BuiltBy, SerialNumber, and...
11
3674
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night) and the 'employee name'. There is another table which assigns an ID to the Shifts, i.e. 1,2 and 3 for morn, eve & night shifts respectively. From the mother table, the incentive is calculated datewise for each employee as per his shift duty. In...
4
1337
matrekz42
by: matrekz42 | last post by:
Hello, I currently have a database which consists of about 100 queries. I want to create a button in a form that will run all 100 queries, but at the same time the user can pick the date range, by entering the dates. ie: textStartDate - textEndDate, in a form. This would change the date range on all the queries. What should I do? Thanks in advance.
19
1703
by: eskelies | last post by:
I have two queries. My goal is to pull a range of numbers that fall on or in a certain date range. For example, $100 on 9/1/2007 and $200 on 9/24/2007. I want the date range to pick up both the 100 and 200 dollars. From there I will sum them. The key is I only want current month. The following SQL is already written for both Queries. My issue is in the second query I receive #error. Query 1: SELECT ., Month(Date()) & "/1/" &...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.