SQL Report by PC Ship Date
Ok i know NOTHING about SQL, but I've peiced together a report to try and pull all of our pc's that are 3 years old and older by Dell's ship date. It's not right becuase it will list all of our pc's with the same service tag and then list all the pc's with the next service tag and so on (Hope that makes sense.) This is what I have.
SELECT USER_FULLNAME,M.NAME AS COMPUTER_NAME,DA.SERVICE_TAG,DATE_FORMAT(DA.SHIP_DATE,'%Y/%m/%d')AS SHIP_DATE FROM KBSYS.DELL_ASSET DA, MACHINE M WHERE DA.SHIP_DATE < (CURRENT_DATE - INTERVAL 3 YEAR)
Any help would be much appreciated!!
Answers (2)
Try this:
SELECT USER_FULLNAME,M.NAME AS COMPUTER_NAME,DA.SERVICE_TAG,DATE_FORMAT(DA.SHIP_DATE,'%Y/%m/%d')AS SHIP_DATE
FROM KBSYS.DELL_ASSET DA
LEFT JOIN MACHINE M ON M.BIOS_SERIAL_NUMBER=DA.SERVICE_TAG
WHERE DA.SHIP_DATE < (CURRENT_DATE - INTERVAL 3 YEAR)
Comments:
-
Thanks a lot! That was it! - BDEEN 11 years ago