-
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?
-
where trunc(effdt) = trunc(sysdate) that will only give you the day, month and year - no time component
-
Thanks a lot. That did it. If you don't mind one more question why did that work?
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|