Exclude specific records from query

In the attached code I added...
     AND (h.JobCode <> 3 OR h.JobCode <>5)
What I want is to not include the record if the JobCode for that record is 3 or if the JobCode is 5.  The query runs with my code but the records with JobCode 3 and 5 are still being included. Can you please show me what I am doing wrong.
Thanks,

SELECT     
	u.UserName as Supervisor, 
	'Begin' as 'Type', 
	a.EmployeeId, 
	a.Name, 
	a.Expected, 
	a.Actual, 
	CONVERT(varchar, FLOOR(a.Tardy / 60.0)) + ':' + RIGHT('0' + CONVERT(varchar, a.Tardy % 60),2) AS HrMin,
	n.ShiftNote
FROM    
    (SELECT     
		CONVERT(varchar(20), s.TimeIn, 100) AS Expected, 
		s.TimeIn, 
		l.LastName + ', ' + l.FirstName AS Name, 
		l.EmployeeId, 
		l.ManagerUID,
		CONVERT(varchar(20), MIN(h.TimeIn), 100) AS Actual, 
			CASE WHEN s.TimeIn < MIN(h.TimeIn) THEN DATEDIFF(MINUTE, s.TimeIn, ISNULL(MIN(h.TimeIn), s.TimeIn)) END AS Tardy, 
		MIN(h.RecordId) AS RecordId
     FROM dbo.EmployeeHours AS h 
	INNER JOIN dbo.EmployeeSchedules AS s ON h.EmployeeId = s.EmployeeId 
		AND DATEADD(day, 0, DATEDIFF(DAY, 0, s.TimeIn)) = DATEADD(DAY, 0, DATEDIFF(DAY, 0,h.TimeIn)) 
	INNER JOIN dbo.EmployeeList AS l ON s.Company = l.Company AND s.EmployeeId = l.EmployeeId
     WHERE (l.Suspend = 0)  AND (h.JobCode <> 3 OR h.JobCode <>5) AND (DATEADD(DAY, 0, DATEDIFF(DAY, 0, h.TimeIn)) 
     BETWEEN @From AND @To)AND Class in (2,4,6,7) 
GROUP BY l.EmployeeId, l.ManagerUID, s.TimeIn, l.LastName, l.FirstName) AS a 
	LEFT OUTER JOIN dbo.UserList AS u ON a.ManagerUID = u.UID 
	LEFT OUTER JOIN dbo.EmployeeShiftNotes AS n ON a.RecordId = n.RecordId AND a.EmployeeId = n.EmployeeId
WHERE (a.Tardy >= 0)  
 AND (u.UserName = @Supervisor)
 AND u.Company = 1

Open in new window

BobRosasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
AND h.JobCode NOT IN (3, 5)

or

AND (h.JobCode <> 3 AND h.JobCode <>5)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BobRosasAuthor Commented:
They both worked!  Thank you so much for your quick response and great code!
0
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.