We have a report that we run to tell us when we replaced the an UPS batteries last, however I would like to modifiy this query to have it display only UPS batteries that were replaced 3 years ago today (today would be the day that we run the report, so today would have to be dynamic and not a static date).
here is the current query that we are using and it works great.. I just can't seem to make it dance to display only UPS batteries that were replaced over 3 years ago.
Thanks in advance
SELECT
Nodes.NodeID AS NodeID
, Caption AS NodeName
, Nodes.Modal AS Modal
, CustomPollerAssignment.AssignmentName AS Assignment
, CustomPollers.UniqueName AS PollerName
, CAST(CustomPollerStatus.Status AS Date) AS ReplacementDate
, ISDATE(CustomPollerStatus.Status) AS ISDATEValid
FROM CustomPollerStatus
JOIN CustomPollerAssignment ON CustomPollerAssignment.CustomPollerAssignmentID = CustomPollerStatus.CustomPollerAssignmentID
JOIN CustomPollers ON CustomPollerAssignment.CustomPollerID = CustomPollers.CustomPollerID
JOIN Nodes ON (Nodes.NodeId = CustomPollerAssignment.NodeId)
WHERE (CustomPollers.UniqueName = 'APCupsBasicBatteryLastReplaceDate') AND (ISDATE(CustomPollerStatus.Status) = 1)
ORDER BY 6 DESC