/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


SQL Report Code For Oldest Computers

09/16/2015 1331 views

I was working with a Kace rep yesterday and we needed a report that would show the oldest machines on our network so we knew which users were most needing of new machines.  We created a SQL query that shows the oldest machines by shipdate in order from oldest to newest. This report works perfectly for us and works great.  We wanted to share the code with you in case you have the same need.  This only works on Dell machines.  Enjoy!  Thank you to Yassine Salhi from the Kace support team!



SELECT DISTINCT M.NAME AS MACHINE_NAME, M.CS_MODEL AS MODEL, DA.SERVICE_TAG, DA.SHIP_DATE,M.USER_LOGGED AS LAST_LOGGED_IN_USER
FROM DELL_WARRANTY DW JOIN DELL_ASSET DA ON (DW.SERVICE_TAG = DA.SERVICE_TAG)
JOIN MACHINE M ON (M.BIOS_SERIAL_NUMBER = DA.PARENT_SERVICE_TAG OR M.BIOS_SERIAL_NUMBER = DA.SERVICE_TAG)
LEFT JOIN DELL_WARRANTY DW2 ON DW2.SERVICE_TAG=DW.SERVICE_TAG
WHERE M.CS_MANUFACTURER LIKE '%dell%'
AND M.BIOS_SERIAL_NUMBER!=''
AND DA.DISABLED != 1
ORDER BY DA.SHIP_DATE ASC;

Answer Summary:
1 Comment   [ + ] Show comment

Comments

  • I just tried this and it worked great. Thanks!

Answer Chosen by the Author

1
Answer ^
Answered 09/16/2015 by: superdave627
White Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ