Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jpjayko
Engaged Sweeper
Trying to query all printers network and local and the model names. on top of excluding certain local options like fax cutepdf etc. I can get report to run but now excluding anything
SELECT
tblcomputers.ComputerUnique,
tblPrinters.Caption,
tblPrinters.Portname,
tblPrinters.Sharename,
tblPrinters.Location,
tblPrinters.Comment
FROM
tblcomputers
INNER JOIN tblPrinters ON (tblcomputers.Computername = tblPrinters.Computername)
WHERE
tblPrinters.Caption NOT LIKE 'Microsoft%' OR
tblPrinters.Caption NOT LIKE 'CutePDF%' OR
tblPrinters.Caption NOT LIKE 'FAX' OR
tblPrinters.Caption NOT LIKE 'Adobe%'
1 REPLY 1
Hemoco
Lansweeper Alumni
You need to use AND instead of OR

SELECT
tblcomputers.ComputerUnique,
tblPrinters.Caption,
tblPrinters.Portname,
tblPrinters.Sharename,
tblPrinters.Location,
tblPrinters.Comment
FROM
tblcomputers
INNER JOIN tblPrinters ON (tblcomputers.Computername = tblPrinters.Computername)
WHERE
tblPrinters.Caption NOT LIKE 'Microsoft%' AND
tblPrinters.Caption NOT LIKE 'CutePDF%' AND
tblPrinters.Caption NOT LIKE 'FAX' AND
tblPrinters.Caption NOT LIKE 'Adobe%'

Reports & Analytics

Ask about reports you're interested in and share reports you've created. Subscribe to receive daily updates of reports shared in the Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now