473,513 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to Filter Based on Date Ranges

121 New Member
I have a query where I want to find records where they are between two dates.
I am currently using the criteria of :

>[FORMS]![Report - Data Owner Record Status].[MIN_DATE]
<[FORMS]![Report - Data Owner Record Status].[MAX_DATE]

But it doesn't work. The query filters out all records.

What do I have to do to fix this?


Thanks for any help I can get.
May 2 '07 #1
9 2023
JimInAJam
7 New Member
Is the data on the form a date type?

Have you tested to see if half of the expression works?

Have you tried to put constant form the form in the select list so that you can check its picking up and evaluating.
May 3 '07 #2
CrostonScottish
36 New Member
In your query you could set the criteria for the date field you want to filter by to:
Between [Enter begining date] And [Enter Finish Date ]

This will prompt the user when they run the query to input a start date then an end date.

Hope this is what you are looking for.
May 3 '07 #3
JHNielson
121 New Member
Thanks for everyone's help.

Yes, the form fields are formatted as dates. I don't want to make them enter a date in the query prompt, because they are already entering a date in the form.

Any other ideas?
May 3 '07 #4
Rabbit
12,516 Recognized Expert Moderator MVP
Shouldn't you use BETWEEN?
The way your criteria is set up right now it'll return all dates.

As long as the field in your table is a date format and the control on the form is a date format it should work.
May 3 '07 #5
JHNielson
121 New Member
Shouldn't you use BETWEEN?
The way your criteria is set up right now it'll return all dates.

As long as the field in your table is a date format and the control on the form is a date format it should work.
I've never used the BETWEEN syntax. What is the syntax for BETWEEN? That might be what I need to do.


Thanks
May 3 '07 #6
Rabbit
12,516 Recognized Expert Moderator MVP
FieldName BETWEEN Value1 AND Value2
May 3 '07 #7
JHNielson
121 New Member
FieldName BETWEEN Value1 AND Value2

Thanks again - Works great!
May 3 '07 #8
Rabbit
12,516 Recognized Expert Moderator MVP
Good Luck.
May 3 '07 #9
NeoPa
32,557 Recognized Expert Moderator MVP
FieldName BETWEEN Value1 AND Value2
That's the most usual form, but it can be used more flexibly. For instance, to determine if a record (which has [StartDate] & [EndDate] fields) is currently active, you could say (in SQL mode) :
Expand|Select|Wrap|Line Numbers
  1. WHERE Date() Between [StartDate] And [EndDate]
May 5 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
776
by: bobb | last post by:
Is there a way to select count(*) by grouping by date, and having multiple date ranges? combining... select field,count(*) from table where datefield > 2004/1/1 and datefield < 2004/1/31 and...
6
4730
by: Yeah | last post by:
I have alternate holiday headers for my web site, and I would like to display a certain image for an upcoming holiday. Examples: Christmas 12/10 - 12/26 New Years Eve 12/27 - 1/2...
12
6338
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...
2
1524
by: andrew007 | last post by:
I have a question about dataset rowfilter. I have a list of event table in a database. each event has start-date and end-date column. I grab these from db and save to dataset. And then I have to...
1
1375
by: Richard Fagen | last post by:
Hi, What are the best practices to filter a datagrid based on user input? For example: I want to display a grid with rows of sales information and allowed the users to specify options (ex:...
67
7601
by: PC Datasheet | last post by:
Transaction data is given with date ranges: Beginning End 4/1/06 4/4/06 4/7/06 4/11/06 4/14/06 4/17/06 4/18/06 4/21/06 426/06 ...
9
6082
by: dee | last post by:
I'd like to filter by the following criteria: left(LeadDisposition,3) = "Sit" AND Appt_Date = Text767 I have no idea how to do this. Appreciate help.
10
2367
by: kyosohma | last post by:
Hi, I am working on a timesheet application in which I need to to find the first pay period in a month that is entirely contained in that month to calculate vacation time. Below are some example...
0
1712
by: feeblemind | last post by:
Hi everyone, I am having problem/troubles with creating an sql inline statement for our application. How do I create a statement/query that selects list of servers with defined date ranges, but...
6
2733
by: DAHMB | last post by:
I have a report based on a query called qryMonthlyReport. I have a form that I use to launch the report, on the form I have two date fields I used to filter the query. I want to use the query w/o...
0
7257
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
7379
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,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7521
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...
1
5084
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
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
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 ...
0
455
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.