/build/static/layout/Breadcrumb_cap_w.png

SQL smart label doesn't apply to any machine

I have a smart label to find machines (DELL) which were bought on 2014. I created a report with the same sql code and it works fine, the problem is on smart labels, it doesn't apply to any machine. What i'm doing wrong?

The sql is:

SELECT M.NAME, D.SHIP_DATE FROM MACHINE M JOIN DELL_ASSET D ON D.SERVICE_TAG = M.BIOS_SERIAL_NUMBER WHERE ((M.NAME like 'LAB%') AND (D.SHIP_DATE like '%2014%'))




0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Two things to do: 1st- Must include "MACHINE.ID as TOPIC_ID" on the select clause. 2nd- Must _NOT_ use table abreviations. So, the final SQL is: SELECT MACHINE.NAME, MACHINE.ID as TOPIC_ID FROM MACHINE JOIN DELL_ASSET ON DELL_ASSET.SERVICE_TAG = MACHINE.BIOS_SERIAL_NUMBER WHERE ((MACHINE.NAME like 'LAB%') AND (DELL_ASSET.SHIP_DATE like '%2014%'))
Posted by: chucksteel 7 years ago
Red Belt
0

Top Answer

Most of my smart labels include MACHINE.ID as TOPIC_ID in the select clause, that might be a requirement for them to work, but I'm not positive.

Comments:
  • Worked! Also chaged the abreviation for the tables for it to work. Thanks! - eduardo.caron 7 years ago
    • Could you share how the final SQL looks like? - Channeler 7 years ago
 
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