How to Create a query to include Department, Asset Tag and User
- Department
- Asset Tag
- User
- Service Tag
- Purchase Date
Answers (1)
The information you’re looking for is in two tables – DELL_ASSETand USER. I haven’t seen a Purchase Date field before but there is a SHIP_DATEfield in the DELL_ASSET table. To gather the information you’re after you’llneed to connect (JOIN) the DELL_ASSET and USER tables to the MACHINE table. Hereis a query I use but I have left of the conditions because yours would beunique to your requirements. You’ll need to add your own WHERE lines. The DELL_ASSETtable fields are aliased with D.fieldname, The MACHINE table fields are aliasedwith M.fieldname. I did not alias the USER table.
“SELECT D.SHIP_DATE, M.USER_LOGGED AS Logged_in_User,M.USER_NAME, USER.FULL_NAME, USER.DOMAIN, USER.BUDGET_CODE, M.NAME ASComputer_Name, M.CS_MODEL AS Model, M.CHASSIS_TYPE AS Type, M.LAST_SYNC,M.LAST_INVENTORY
FROM MACHINE M
JOIN DELL_ASSET D ON D.SERVICE_TAG = M.BIOS_SERIAL_NUMBER
JOIN USER on USER.USER_NAME = M.USER_NAME
WHERE”
Please know that I am an infrequent Ninja visitor. I may not respond to additional questions quickly ;) There are other serious Ninja users who may be able to assist further. I hope this enough to get you started.