list of printers
Hi,
I'm trying to create a report of printers installed on all computers. I've gone through the report wizard and select other.printers. My problem is that it seems to jumble the output (puts multiple printers on the same line)
Here's my sql query
SELECT MACHINE.USER_NAME AS MACHINE_USER_NAME, PRINTERS FROM MACHINE ORDER BY MACHINE.USER_NAME asc
Thanks
I'm trying to create a report of printers installed on all computers. I've gone through the report wizard and select other.printers. My problem is that it seems to jumble the output (puts multiple printers on the same line)
Here's my sql query
SELECT MACHINE.USER_NAME AS MACHINE_USER_NAME, PRINTERS FROM MACHINE ORDER BY MACHINE.USER_NAME asc
Thanks
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
GillySpy
13 years ago
The printers are all stored in one text field separated by carriage returns. To get a report of one line per printer you would have to make a list of your printers somewhere and join that to machine. Here's an example:
SELECT ID, PRINTERS, P1 FROM MACHINE M LEFT JOIN (select 'Microsoft XPS Document Writer' P1 UNION ALL select 'Adobe PDF' P1) PRINTER
ON FIND_IN_SET(P1,REPLACE(PRINTERS,'\n',','))>0
WHERE P1 IS NOT NULL
ORDER BY 1,3
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.