I am trying to get the name of the day of a specific date. For example for the date "11/22/2019" I want the result to be "Friday"
I use Amazon Redshift.
Any ideas?
Thanks
I am trying to get the name of the day of a specific date. For example for the date "11/22/2019" I want the result to be "Friday"
I use Amazon Redshift.
Any ideas?
Thanks
You can use to_char()
:
select to_char(datecol, 'Day')
Note that this value is padded to 9 characters, so for most weekdays, it will end in a bunch of spaces.
To avoid empty space in the output of 'select to_char(current_date, 'Day');' and to get the exact day name you can use the below query.
select trim(' ' FROM to_char(current_date, 'Day'));
© 2022 - 2024 — McMap. All rights reserved.