Blame | Last modification | View Log | Download | RSS feed
select
max(report_date) 'Last Report',
sysinfo_report.device_id 'Device ID',
device.name 'Device',
site.name 'Site',
client.name 'Client'
from
sysinfo_report
join device using (device_id)
join site using (site_id)
join client using (client_id)
where
device.removed_date is null
and site.name <> 'Stock'
group by
device_id
having
max(report_date) < date_sub( now(), interval 3 month)
order by max(report_date);