Good Afternoon,
I trying to write a select statement to show all work orders opened based on current date or previous day or 30 days. If I try to use getdate() Maximno does not support. The below example is for previous day. This SQL script works perfectly in MS SQL Server Management Studio.
SELECT count(*) FROM [xxx].[xxx].[WORKORDER] where CONVERT(DATE,REPORTDATE) = CONVERT(DATE,GETDATE()-1) and ((woclass = 'WORKORDER' or woclass = 'ACTIVITY') and historyflag = 0 and istask = 0 and siteid = 'PHYSPLNT');
Is there a better way to approach this query ?
Much....Thanks
#Reporting------------------------------
D Keith Henderson
University of Louisville Physical Plant
------------------------------