![]() |
|
Archives of the TeradataForumMessage Posted: Fri, 06 Mar 2009 @ 16:53:33 GMT
I'd be inclined to use the system calendar table, like this:
SEL day_of_year
, ((year_of_calendar * 10000) + 1231 (DATE)) - ((year_of_calendar * 10000)
+ 0101 (DATE)) + 1 (NAMED days_in_year)
, (CAST(day_of_year AS FLOAT) / CAST(days_in_year AS FLOAT)) * 100
(DECIMAL(15,12))(NAMED complete_pct)
FROM sys_calendar.calendar
WHERE calendar_date = DATE;
JL
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||