K1000 Adding an "Assigned To" field on report
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.
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
ondrar
6 years ago
Top Answer
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)