473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

date range query

Hi

My job currently requires me to enter data from 300+ forms a month.
The system which we used in Excel was slow , and theprevious guy had
three workbooks for this job .
I have created a table in Access with four fields
Date Location Number of Adult Visitors Number of
Chikd Visitors
I have created queries to tell me how many occurances of Location and
total and average number of visitors there are in the table and this
works fine for reporting purposes.
We keep data on a month by month basis
It has been decided that we will keep all data in a single database
from now on.
What I need to do is rewrite the queries so that I can query a date
range rather then the entire table.
How do I do this?
brian

May 13 '07 #1
1 9109
flumpuk wrote:
Hi

My job currently requires me to enter data from 300+ forms a month.
The system which we used in Excel was slow , and theprevious guy had
three workbooks for this job .
I have created a table in Access with four fields
Date Location Number of Adult Visitors Number of
Chikd Visitors
I have created queries to tell me how many occurances of Location and
total and average number of visitors there are in the table and this
works fine for reporting purposes.
We keep data on a month by month basis
It has been decided that we will keep all data in a single database
from now on.
What I need to do is rewrite the queries so that I can query a date
range rather then the entire table.
How do I do this?
First change the name of that field to VisitDate (Date is a reserverd word).
The use a query with criteria on the VisitDate field like...

Field VisitDate
Criteria >=#2007-05-01# AND <#2007-06-01#

That will return all records for May and it will work whether VisitDate contains
date only (all times set to midnight) or date and time. If you store all
midnight times and are confident that this won't change then you can also use...

Field VisitDate
Criteria BETWEEN #2007-05-01# AND #2007-05-31#

I used the ISO format for my date literals because it is best to use a
non-abiguous format. If you don't use a non-ambiguous format then you must use
US format m/d/yy or m/d/yyyy.

You could of course have the query pull the criteria from an open form where you
could specify the date range...

Field VisitDate
Criteria BETWEEN Forms!NameOfForm!StartDate AND Forms!NameOfForm!EndDate

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

May 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3270
by: isetea | last post by:
Hi, I want to create a from where user can select from a date range / type in a date range to get only data from an underlying query within this range. This should overwrite the existing criteria...
3
2036
by: Don | last post by:
Hi, I would like my users to be able to enter STARTDATE and leave the ENDDATE open in the query by form that I have built. Using some code from another group post I have this within my SQL...
1
4666
by: mikevde | last post by:
Hi, I want to select data from a range of dates i.e over a 1 month period I've tried this: SELECT * FROM table WHERE DATE_SUB(Date(), INTERVAL 30 DAY) but the query isnt working as it is...
2
13985
by: sixdeuce62 | last post by:
Hello, I am trying to create a query that will prompt me to enter the parameter value if beginning date and ending date. I have created everything I need in the query, but I have to manually go...
19
3906
by: ali3n8 | last post by:
Hello I have attempted to create a date range report from a query called qrycustomerinformation. The field that contains the value of my date is called Followup. When i run a report on this it is...
3
2738
by: RoadRunner | last post by:
Hi, I am having a problem. I have a very simple employee database. The client needs to see everything on a form before any updates or deletions can be made. I have a form that loads with two...
20
1957
by: kujito | last post by:
I'm working with mine production data in Access 2007. I'll try to make this make sense and keep it simple (mostly to not confuse myself further). The range of years operating varies between...
12
2194
by: jamieboy86 | last post by:
Hi Everyone, I'm new here and to access as well, The problem I'm having right now is that I made a Query that upon the input of a date, it will search for the last purchase I made and at what...
19
5991
by: phill86 | last post by:
Hi I am re-posting this thread because it has become very confusing and I have got some way to solving the problem so it is a slightly different question from the initial thread. here is the...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
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...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7093
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...
0
5676
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,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
452
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...

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.