Home > Net >  Amazon Redshift- How to get start date of the Week from existing daily date field from the table?
Amazon Redshift- How to get start date of the Week from existing daily date field from the table?

Time:05-17

I am trying to get start date of the week from existing daily date field from the same table. For example daily dates from 05/08/2022 to 05/14/2022 , the start of the week date output need to come as 05/08/2022 for all days in the week. week start on Sunday.

Also similar thing require to first date of the Month and quarter(3 month division)

CodePudding user response:

The date_trunc() function performs this operation - https://docs.aws.amazon.com/redshift/latest/dg/r_DATE_TRUNC.html

  • Related