Home > Software design >  Upper case day of week in Teradata SQL
Upper case day of week in Teradata SQL

Time:02-27

I can get the day of the week from a data but I can't seem to convert to uppercase

This is the statement I'm using:

CAST(CURRENT_DATE AS DATE FORMAT 'e4') (CHAR(9))

How can I convert this to uppercase?

I've tried wrapping UPPER around each of the elements of the statement but I get errors each time

UPPER(CAST(CURRENT_DATE AS DATE FORMAT 'e4') (CHAR(9)))
UPPER(CAST(CURRENT_DATE AS DATE FORMAT 'e4')) (CHAR(9))

Any help would be greatly appreciated

CodePudding user response:

While it would be possible to fix your current code

Upper(Cast(Cast(Current_Date AS FORMAT 'E4') AS CHAR(9)))

it's better to switch to

To_Char(Current_Date,'DAY')
  • Related