Skip to content
Advertisement

Snowflake SQL How to get only values from the last full week

I’m trying to build a query that would get me only the results with a created date from the last full week. So, for example, if today is Monday 2021-06-28, I only want the results from Monday 2021-06-21 to Sunday 2021-06-27.

I tried with this, but this is the last 7 days, without considering week end or start.

I also tried working with this function:

and then trying to substract 7 days, but I think my use of these functions is incorrect.

Advertisement

Answer

Use date_trunc():

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement