/build/static/layout/Breadcrumb_cap_w.png

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!!


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: jaredv 12 years ago
Fourth Degree Green Belt
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
Posted by: BDEEN 11 years ago
White Belt
0

Thanks a lot! That works perfectly!

Don't be a Stranger!

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

Sign up! or login

View more:

Link

Related Links

Post

Related Posts

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