Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL date inquiry

Re: SQL date inquiry

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Thu, 17 Sep 1998 13:40:03 +0100
Message-ID: <6tqvtt$or6$1@schbbs.mot.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US