I have a database with fault records. I am trying to create a query to return incidents reported more than 30 days ago.
This is the code I an using:
SELECT `IncidentNumber`,
`DateReported`,
`ReportedBy`,
`AffectedSystem`,
`EquipmentName`,
`SerialNumberOfAffectedPart`,
`Notes`,
`JobStatus`
FROM `incident_tbl`
WHERE `JobStatus` != 'Closed'
AND `DateReported` < 'DATEADD(day, -30, GETDATE())'
LIMIT 0 , 100
I have read numerous posts here, and elsewhere on the internet and have no idea why this won't work.
The code simply returns all open incidents.
Any help is much appreciated.
Thanks