Hey Guys,

I'll keep this one short and sweet. Here's some SQL to create a label for all machines older than 2 years old.

 

SELECT *, 
       Unix_timestamp(NOW()) - Unix_timestamp(LAST_SYNC) AS LAST_SYNC_TIME, 
       Unix_timestamp(MACHINE.LAST_SYNC)                 AS LAST_SYNC_SECONDS 
FROM   ORG1.MACHINE 
       LEFT JOIN KBSYS.KUID_ORGANIZATION 
         ON ( KUID_ORGANIZATION.KUID = MACHINE.KUID ) 
       LEFT JOIN KBSYS.SMMP_CONNECTION 
         ON ( SMMP_CONNECTION.KUID = MACHINE.KUID 
              AND KUID_ORGANIZATION.ORGANIZATION_ID = 1 ) 
       JOIN KBSYS.DELL_ASSET DA 
         ON ( MACHINE.BIOS_SERIAL_NUMBER = DA.SERVICE_TAG ) 
WHERE  DA.SHIP_DATE < DATE_SUB(NOW(), INTERVAL 2 YEAR) 

 

 

Hope it helps.