That function is missing in Teradata.
You have to calculate it or use a join to a/the system calendar.
sel
case (current_date - date '0001-01-01') mod 7
when 0 then 'Monday'
when 1 then 'Tuesday'
when 2 then 'Wednesday'
when 3 then 'Thursday'
when 4 then 'Friday'
when 5 then 'Saturday'
when 6 then 'Sunday'
else ''
end;
select
case day_of_week
when 2 then 'Monday'
when 3 then 'Tuesday'
when 4 then 'Wednesday'
when 5 then 'Thursday'
when 6 then 'Friday'
when 7 then 'Saturday'
when 1 then 'Sunday'
else ''
end
from sys_calendar.calendar
where calendar_date = current_date;
You usally put that CASE into the calendar definition....
When you already run V2R5, it's
sel trim(current_date (format 'eeee'));
And in the next release there will be User Defined Functions to do all that missing stuff ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.