473,671 Members | 2,484 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 2041
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,569 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 select field,count(*) from table where datefield > 2004/2/1 and datefield < 2004/2/29
6
4748
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 Halloween 10/15 - 11/1 etc. etc. If the date doesn't fall in any upcoming holiday ranges, then the default image is displayed.
12
6370
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.
2
1530
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 do rowfilter of dataset to filter based on user's input. Users can select the following as dropdown for filtering. - last 30 days - last 7 days - today - all pasts
1
1378
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: customer and date ranges), then when they click the 'apply filter' button, I want the rows filtered. I've read about methods using a dataview with the rowfilter and sort
67
7684
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 4/30/06 I am looking for suggestions on how to find the date ranges where there were no transactions.
9
6091
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
2380
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 date ranges: December 31, 2006 January 13, 2007 # doesn't earn January 14, 2007 January 27, 2007 # does earn January 28, 2007 February 10, 2007 # doesn't
0
1721
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 once a server of the same name has date ranges within the date range of another, I will have to get the date range that contains them all. For easy understanding here's a snapshot of data (the Before and After screenshots). BEFORE: Id ServerName...
6
2738
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 the filter with other reports so I would like to add the date filter in VB when I click my Run Reports button. I have created the following but the date filter will not work. Any ideas? Thanks in advance. Dan Private Sub btnRun_Click() On...
0
8401
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,...
0
8926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8673
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
7444
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...
1
6236
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
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
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2818
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
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.