Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Date diff
Hmm.. I think I just got it.
SELECT((TO_CHAR(<date column>, 'DDD') - TO_CHAR(SYSDate, 'DDD')) * -1) FROM <table>;
Brian
On Wed, 18 Oct 2000 17:49:05 GMT,
SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK (Brian Tkatch)
wrote:
>I'd like to have a query return the amount of days SYSDate id before
>the date field in a table, excluding the year.
>
>Table
>==========
>1 2/27/1998
>2 2/28/1999
>3 2/29/2000
>4 3/01/2001
>5 3/02/2001
>
>
>Imagine today is 2/26/2001
>
>The return should be
>
>Query
>======
>1 1
>2 2
>3 3
>4 3
>5 4
>
>I'm not that concerned about Feb 29. I'd like like to take it into
>consideration. My main concern is the date difference itself.
>
>Brian
>
>
>
>
Received on Wed Oct 18 2000 - 13:19:12 CDT
![]() |
![]() |