473,378 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Prompting for a date range in nested query

1
MS ACCESS

I want to selct data between two dates.
I want the query to prompt me for a "cutoffdate"
then select between that date and the preceding 7 days.

I.e. give me 7 days of data based upon the date I entered at the prompt.
Dec 21 '14 #1
1 1031
NeoPa
32,556 Expert Mod 16PB
First let's clarify the question (As you manage to contradict yourself). I suspect you mean the selected date and the previous six days making a total of seven days. I will work to that assumption.

You can cause an Access query to prompt for information by referencing something in square brackets [] that is otherwise unknown. Also, multiple references to the same enclosed text will only prompt the once.

So, for the requirement specified you want a query whose SQL is of the form :
Expand|Select|Wrap|Line Numbers
  1. SELECT [YourTable].*
  2. FROM   [YourTable]
  3. WHERE  ([YourTable].[SomeDate] Between DateAdd('d',-6,CDate([Please select date])) And CDate([Please select date]))
Dec 21 '14 #2

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

Similar topics

2
by: david.isaacks | last post by:
I have a table with an as a field with the date/time in it. Formated like "3/20/2006 7:25:00 AM" I want to be able to create a query for just the dates in Feb, March, April, etc.. I do want to...
1
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...
6
by: delsay | last post by:
I am attempting to create a query that creates a Count for each month and year combo starting in 1992 (Jan 1992, Feb 1992). The field Purchase Date contains dates that are in the Date/Time format. ...
2
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...
1
by: flumpuk | last post by:
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...
1
by: devyon122 | last post by:
I'm trying to allow a user to type in a beginning data and an ending date to be used in a crosstab query - Below is the query: TRANSFORM Count(imagingdb.ID) AS CountOfID TRANSFORM...
19
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...
1
by: kappa | last post by:
I have a problem in ALL my queries when I run a specific date range. Access always crashes when I view in Datasheet view. This doesn't occur if it's a parameter query and I am prompted to enter the...
4
by: rekhasc | last post by:
hi friends.. i am using sql server 2005 reporting services.. in database the table contains startdate row and enddate row... i want the query which display all the contents between these...
19
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.