Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL date inquiry
>
>Time defaults to 12:00am for dates. If you have time, then you need
>to check for the date being between date=> and <date +1.
>
>I've got a nasty looking algorythem that works. It converts date to
>char adds 1, then converts back to date to do the arithmatic. I'd
>love to see a simpler solution.
>
Make sure both sides of the comparison are both date format and then TRUNC both sides
i.e. AND TRUNC(date1) = TRUNC(date2)
This will be true if the days are the same regardless of times. It sames the date arithmetice (adding one) and an extra test. Received on Thu Sep 17 1998 - 07:40:03 CDT
![]() |
![]() |