DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: sysdate value

  1. #1
    Join Date
    Mar 2005
    Posts
    143

    sysdate value

    I have a table that has a field called effdt. When a user makes a change to the data in the table it creates a new row with the new data and an effdt of when the knew data is effective. I want to write a statement that is part of a program that runs automattically, and selects all rows in the table when the effdt is equall to todays date, where todays date will always be changing. I thought I would say select * from table where effdt = sysdate. That doesn't work because sysdate gives me month day year, and time. Effdt only has month day year so it returns no rows. How can I get just the month day year?

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    where trunc(effdt) = trunc(sysdate) that will only give you the day, month and year - no time component

  3. #3
    Join Date
    Mar 2005
    Posts
    143
    Thanks a lot. That did it. If you don't mind one more question why did that work?

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Quote Originally Posted by jayjabour
    Thanks a lot. That did it. If you don't mind one more question why did that work?
    It changes the time component of the dates on both side to midnight. Then the only difference is the date.

Posting Permissions

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


Click Here to Expand Forum to Full Width