Hi,
I have one would list with problem incidents where I gladly to now filter would like after day or week.
- I need a filter where show me the provided elements from the previous day (filter field:actual_start)
- I need a filter with the provided elements, from the past week (Monday until Sunday) (filter field: actual_start).
I have this already times had and used for an Oracle query
/***************************
Incidents Yesterday
***************************/
selectto_char(inc.ACTUALSTART,'dd.mm.yy')as"Day", inc.SERVICE_NAME, inc.INCIDENTCODE1, inc.ACTUALSTART, inc.ACTUALFINISH
, inc.DESCRIPTION, inc.SOLUTION, inc.CATEGORY, inc.ID
from ao_ovsd.v_incident inc
where inc.INCIDENTWORKGROUP1_NAME like'Service Control Center'
andtrunc(inc.ACTUALSTART)=trunc(sysdate-1)
and inc.INCIDENTCODE1 notlike'Service Available'
OrderBy ACTUALSTART asc
/***************************
Incidents Last Week
***************************/
SELECT inc.SERVICE_NAME, inc.INCIDENTCODE1, inc.ACTUALSTART, inc.ACTUALFINISH
, inc.DESCRIPTION, inc.SOLUTION, inc.CATEGORY, inc.ID
FROM ao_ovsd.v_incident inc
WHERE(inc.INCIDENTWORKGROUP1_NAME Like'Service Control Center')
AND(to_char(inc.ACTUALSTART,'YYYY')=to_char(sysdate,'YYYY'))
AND(to_number(to_char(inc.ACTUALSTART,'IW'))=to_number(to_char(sysdate,'IW'))-1)
AND(inc.INCIDENTCODE1 NotLike'Service Available')
OrderBy ACTUALSTART asc
I need now exactly the same however for ms sql
regards