I am a subcontractor remotely logging into another company to change status types.
The query below will give me all required status's for that day for checking purposes.
from workorder wo
inner join connection c
on c.wonum = wo.wonum
inner join addresscache ac
on ac.addresscode = wo.addresscode
and wo.status in ('AWPRACCOMP','PLANNED','APPR','AWSUBCOMP','SUBCOMP','QUERY','CLARIFY','WAPPR','PRACCOMP','QUERYCLOSED')
and cast(wo.statusdate as date) = cast(getdate() as date)
What I would like is for the query not only to list the status for that day (being status date) but also go back five days.
I believe the last line of the query to be the problem.
Any help would be much appreciated.