Trying to build a simple SQL query... I have a table filled with "Yes" and "No"
I want a view that only shows me records that contain "No"
SELECT PhysicalBuild.Name AS Name,
PhysicalBuild.Labels AS Labels,
PhysicalBuild.DNSDRAC AS DNSDRAC,
PhysicalBuild.DNSHOST AS DNSHOST,
PhysicalBuild.PRTGDRAC AS PRTGDRAC,
PhysicalBuild.PRTGHOST AS PRTGHOST,
PhysicalBuild.LouKVM AS LouKVM,
PhysicalBuild.SwitchPorts AS SwitchPorts,
PhysicalBuild.FiberSwitch AS FiberSwitch
FROM PhysicalBuild
But I want it to be WHERE * = "No" or something to that effect.... my syntax is incorrect. anyone?
EDIT: I came up w/ this. Is there a cleaner/easier way to handle this? How about a way to change the records that contain "Yes" into NULL so they aren't displayed? So only the No's are shown?
SELECT PhysicalBuild.Name AS Name,
PhysicalBuild.Labels AS Labels,
PhysicalBuild.DNSDRAC AS DNSDRAC,
PhysicalBuild.DNSHOST AS DNSHOST,
PhysicalBuild.PRTGDRAC AS PRTGDRAC,
PhysicalBuild.PRTGHOST AS PRTGHOST,
PhysicalBuild.LouKVM AS LouKVM,
PhysicalBuild.SwitchPorts AS SwitchPorts,
PhysicalBuild.FiberSwitch AS FiberSwitch
FROM PhysicalBuild
WHERE (PhysicalBuild.Labels = 'No') OR
(PhysicalBuild.DNSDRAC = 'No') OR
(PhysicalBuild.DNSHOST = 'No') OR
(PhysicalBuild.PRTGDRAC = 'No') OR
(PhysicalBuild.PRTGHOST = 'No') OR
(PhysicalBuild.LouKVM = 'No') OR
(PhysicalBuild.SwitchPorts = 'No') OR
(PhysicalBuild.FiberSwitch = 'No')
