Date Range Criteria with Single Date Prompt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • valve2nd
    New Member
    • Jun 2007
    • 1

    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:
    Code:
    DATE  BETWEEN  @variable('Begin Date:') AND @variable('End Date:')
    This also works (using the sys date):
    Code:
    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:
    Code:
    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!
  • frozenmist
    Recognized Expert New Member
    • May 2007
    • 179

    #2
    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

    Comment

    Working...