473,320 Members | 2,098 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,320 software developers and data experts.

Date Range Criteria with Single Date Prompt

This is probably a bonehead question, but I can't make it work. I want to prompt the user for a single date and select all records with a date falling within the week prior.

Obviously this works:
Expand|Select|Wrap|Line Numbers
  1. DATE  BETWEEN  @variable('Begin Date:') AND @variable('End Date:')
This also works (using the sys date):
Expand|Select|Wrap|Line Numbers
  1. DATE  BETWEEN  to_date(to_char(current_date,'mm/dd/yy'),'mm/dd/yy')-7 AND to_date(to_char(current_date,'mm/dd/yy'),'mm/dd/yy')
This doesn't:
Expand|Select|Wrap|Line Numbers
  1. DATE  BETWEEN  to_date(to_char(@variable('End Date:'),'mm/dd/yy'),'mm/dd/yy')-7 AND @variable('End Date:')
What am I doing wrong? Any help is greatly appreciated!
Jun 11 '07 #1
1 2401
frozenmist
179 Expert 100+
Hi,
As you have posted this question in the articles section of oracle, I want to move it to its respective forum. Can you please specify which database you are using, so that the thread can be moved to the proper forum and your question can be discussed by the experts there.
Please do not post questions in the articles section.

Thank You
MODERATOR
Jun 12 '07 #2

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

Similar topics

4
by: Lyn Duong | last post by:
Hi I am trying to retrieve data from a db2 v8.1 fp2 database via msquery and I use the add-criteria function to allow users to input a data parameter. The value is inputted as YYYY-MM-DD but...
5
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I...
4
by: Tony | last post by:
Hey guys, I use Google Groups quite a bit as it is an enormous wealth of information, and now I need some help. I have created a query using parameters to capture a range of date, the date is...
12
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...
4
by: gregork | last post by:
I have a query to return records within a date range. I have a prompt to enter a start and end date which works fine as long as I enter the date in mm/dd/yy format (even though the date field is in...
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
1
by: John Feeley | last post by:
am tring to add a number of years to a dob. im doing this by adding my date+years*365.26 I get a string of numbers. I then convert the number in the next column to actual date again. I'm getting...
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...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.