By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,785 Members | 2,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,785 IT Pros & Developers. It's quick & easy.

Date Range Criteria with Single Date Prompt

P: 1
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
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 179
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
Jun 12 '07 #2

Post your reply

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