Help getting all rows where created = this week

I thought this would work -

WEEK(created, 7) = WEEK(NOW(), 7) AND YEAR(created) = YEAR(NOW())

Shouldn’t this row be included in the above query?

Hello @Tim_Jones ,
I checked for me this query works as expected,
data created over the current week is returned.
Detailed documentation

Can you clarify what time and day of the week you made this request?

Regards,
Sergey

Hi @Sergey_Androsov

I ran the queries just before posting.

Thanks,
Tim

Then you made a request already in the new week,
WEEK(‘2024-09-20’,7) = 38 (38th week in which the record was created)
WEEK(NOW(),7) = WEEK(‘2024-09-23’,7) = 39 (you get data for week 39)
38 ≠ 39

Accordingly, this record should not have been present in the data sample.

Regards,
Sergey

Ah, right. Because the time is in UTC, it was already week 39 when I ran the query.

Thanks for pointing that out. I should have slept on it.

Tim