SQL Server Get List of activities in CRM from week 36

tf7tbtn2  于 2023-02-21  发布在  其他
关注(0)|答案(1)|浏览(106)

I need to get a list of actions for week 36 of 2022 from the entire database list ("Сustomers" data base)

I tried to do it this way, but it gives out only the activity of the first day of the week

DATEADD(week, 36, '2022')
lymgl2op

lymgl2op1#

This should be what you are looking for, read more about DATEADD function:

SELECT
    *
FROM
    crm_table
WHERE
    action_time
BETWEEN 
    DATEADD(week, 36, '2022') 
AND 
    DATEADD(second, -1, DATEADD(week, 37, '2022'))

相关问题