Reputation: 3797
I have a simple enough query that works well:
SELECT
Name, JobStatus
FROM
ScheduleRequest
WHERE
ScheduleDate >= '2018-07-11'
AND
JobStatus <> 6
I need to check for different values in the same field 'JobStatus'. When I try to alter the query like this, I'm finding only the last value of 95 is showing?
SELECT
Name, JobStatus
FROM
ScheduleRequest
WHERE
ScheduleDate >= '2018-07-11'
AND (JobStatus <> 6
OR JobStatus <> 0
OR JobStatus <> 1
OR JobStatus <> 4
OR JobStatus <> 95
)
Upvotes: 2
Views: 43
Reputation: 2814
Use NOT IN
expression
SELECT
Name, JobStatus
FROM
ScheduleRequest
WHERE
ScheduleDate >= '2018-07-11'
AND JobStatus NOT IN (6, 0, 1, 4, 95)
Upvotes: 3