/build/static/layout/Breadcrumb_cap_w.png
08/29/2018 546 views
For the life of me I can't figure out what the SQL is for adding an asset Assignee Name to a report.  All I need is to add a column for assigned to at the end of the report but I can't figure out the nomenclature for it.  Any help is greatly appreciated.
Answer Summary:
0 Comments   [ + ] Show comments

Comments


Answer Chosen by the Author

1
Here's a sample report that will get you that, and some other fields as an example.  You have to join the User table and add the USER.FULL_NAME column to your SELECT to get their name.  Hopefully you can work this info into your report, and let me know if you have any questions.

SELECT 
  ASSET.NAME,
  ASSET.OWNER_ID,
  USER.FULL_NAME,
  USER.USER_NAME,
  USER.EMAIL

FROM ASSET

JOIN USER ON USER.ID = ASSET.OWNER_ID

WHERE ASSET.ASSET_TYPE_ID = 5

(edit for formatting)
Answered 08/30/2018 by: ondrar
Black Belt