473,881 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Falls Within a Range

4 New Member
I have three fields in a Union Access Query (ID, Begin_Date, End_Date). I want to modify the query to include a parameter date to be entered by the user and produce a result if the parameter date falls within the range of Begin_Date to End_Date. Any ideas?
Sep 20 '07
13 4502
4 New Member
It turns out that the WHERE clause is found WITHIN each SELECT statement so must be duplicated for both tables.
Expand|Select|Wrap|Line Numbers
  1. SELECT [CLIENT_ID], [BEGIN_DATE], [END_DATE] FROM Client_Count_Current_Placement
  2. WHERE [Please enter Date] Between [BEGIN_DATE] And [END_DATE]
  3. UNION SELECT [CLIENT_ID], [BEGIN_DATE], [END_DATE] FROM Client_Count_Historical_Placement
  4. WHERE [Please enter Date] Between [BEGIN_DATE] And [END_DATE]
I appreciate everyone's help. It appears that the above SQL does work and produces the result I desire. Can you help me with this next question: Why am I prompted to enter the [Please enter Date] four times before the code will execute? I would like to just enter the [Please enter Date] once. Any help would be appreciated and thanks for the replies.
Sep 21 '07 #11
32,584 Recognized Expert Moderator MVP
That does surprise me. Can you try saving this SQL in a query and just double-clicking on it to run.
What happens then?
Sep 21 '07 #12
4 New Member
That does surprise me. Can you try saving this SQL in a query and just double-clicking on it to run.
What happens then?
Same occurrence. I have to input the same date within the same dialog box four times before the query runs. Not sure if this has to do with the underlying union query.
Sep 21 '07 #13
296 Recognized Expert Contributor
I don't know what would be causing that, but with my own database, I have noticed that if I create a query with a prompt and then make a bunch of changes, it sometimes requests the prompt more than once. What I do to fix it is to delete the prompt code, run the query without a prompt, then put the prompt code back in. It's worked for me every time, I just don't understand why it does it.
Sep 21 '07 #14

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

Similar topics

by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
by: Stewart Allen | last post by:
I'm trying to filter a table that has 2 date fields, the first date will always have a value but the second will only occasionally has a value. Each date field also has a corresponding text field to record the record's status. Sample data: *tblTest* Model Parts CDate CStatus RDate RStatus 616 $359.79 03-Nov-03 C
by: alexanderpope11 | last post by:
Hello, how do I write this SQL: I would like to check the Main table for invalid rows. An invalid row is: any row where the Start_date to stop_date range overlaps an invalid date in the Code table. For example, Row#2 is invalid because the Start_date-Stop_Date range overlaps 2 days in the code table where the code AA was not valid (12/30/2000 - 12/31/2000) Main Table
by: dfetrow410 | last post by:
Anyone have some code that will do this? Dave
by: DeanMiller | last post by:
I was wondering if there is an easy way to check if a date falls in a given selection range. I have the selection range already made and I want to be able to take a given date and see if it falls within that range. Thank you, -Dean Miller
by: heckstein | last post by:
I am running a query in Access 2003 to pull training courses with a start date that falls within a specified date span such 2/1/07 to 2/28/07. I was using this code - (( I.STARTDATE) Between #2/1/2007# And #2/28/2007#) - but found this excluded courses beginning on the first and last date of my date range. I changed the code to this - (( I.STARTDATE) Between #1/31/2007# And #3/1/2007#) and retreived my missing records, but found I was pulling in...
by: Andrew | last post by:
Having trouble with some date computations. I need to get the date of a specific day within a month - the 1st Thursday or the 2nd Monday, etc. I found an article ( http://www.dotnetspider.com/kb/Article1252.aspx) that gives examples using on the DateAdd() and DateDiff() functions, but it seems that not all of the examples work as described.... and of course, the last example in the article is very close to what I need yet does not work (I...
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. In my VB.NET application I need to identify whether or not a user-input date falls in between certain date ranges. For example, If I know my date range is 4/1/2008 - 5/1/2008, and a user inputs 4/3/2008, I would need a boolean TRUE indicating that the input date falls between date ranges. I know I could do greater than/less than comparisons, but I want to check if there's a simpler way to accomplish this. Thank you.
by: WyvsEyeView | last post by:
I have a datasheet subform on which users select a topic from a combo box populated by a query, qryListTopicsCbo. This query limits the list to only those topics edited within the last n days (where n is supplied by a field on another form). The problem I am having is that if a user has selected a topic in the past but its last edit date now falls outside of the n range, that topic no longer appears on the form. Obviously, I want topics already...
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,...
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,...
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...
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();...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.