|
|
Archives of the TeradataForum
Message Posted: Tue, 05 Mar 2002 @ 22:56:35 GMT
Subj: | | Re: Days between |
|
From: | | Dennis Calkins |
Hi,
you can subtract 2 dates and get the number of days.
sel ( date1 - date2 )
from blort;
You can also use the Sys_calendar database which is provided by DIP. This Database.table contains the 'Calendar' information for every
legal date between Jan 1, 1900 and Dec 31, 2100.
sel yourcolumns, (a.day_of_calendar - b.day_of_calendar )
from
yourtable,
SYS_CALENDAR.calendar a,
SYS_CALENDAR.calendar b
where
a.calendar_date = yourdate1
b.calendar_date = yourdate2;
| |