Results 1 to 5 of 5

Thread: Dates

  1. #1
    Join Date
    Dec 2010
    Posts
    11

    Smile Unanswered: Dates

    Please tell me the appropriate where condition with dates in oracle

    select * from table_name

    where Date_value between sysdate and (sysdate-6months)
    Last edited by varunkumar; 01-05-11 at 19:14. Reason: removed getdate()

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >where Date_value between getdate() and (getdate-6months)

    what is "getdate"?
    Why does leftmost getdate have parenthesis while rightmost does not have them?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Check the manual for the interval data type and specifying an interval literal.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Dec 2010
    Posts
    11

    Smile

    Thank you all very much. I got the idea.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •