SQLTeam.com | Weblogs | Forums

How to capture Next 72hrs data query

Can anyone help me change the condition query to capture the "Next 72hours" data....

I need to get the planned data for next 72hrs report and I will need to run this Daily....

Here's the query:

Select
RITM.[number]
,RITM.[dv_assignment_group]
,RITM.[dv_assigned_to]
,RITM.[dv_cat_item]
,RITM.[dv_state]
,RITM.[dv_u_requested_for]
,USR.[dv_location]
,LOC.[city]
,LOC.[state]
,PA.[dv_u_country]
,PA.[dv_u_region]
,RITM.[short_description]
,TASK.[number]
,TASK.[dv_assignment_group]
,TASK.[dv_assigned_to]
FROM SN.sc_req_item RITM
LEFT OUTER JOIN SN.sys_user USR
ON RITM.[u_requested_for]=USR.[sys_id]
LEFT OUTER JOIN SN.cmn_location LOC
ON USR.[location]=LOC.[sys_id]
LEFT OUTER JOIN SN.u_personnel_area PA
ON USR.[u_personnel_area]=PA.[sys_id]
LEFT OUTER JOIN SN.sc_task TASK
ON (RITM.[sys_id]=TASK.[request_item] AND TASK.dv_assignment_group='global')
WHERE
RITM.[opened_at] >= {ts '2022-05-01 00:00:00'} AND RITM.[closed_at] < {ts '2022-05-07 11:59:00'}