[AccessD] Query trouble

Kaup, Chester Chester_Kaup at kindermorgan.com
Tue Oct 8 15:23:53 CDT 2019


I am trying to use both a not like and not equal statement in the same query. Either criteria work correctly by itself. When I use both nothing is excluded. What might I be doing wrong? Below is the SQL statement. Thanks.

SELECT dbo_DSS_LastStatus.PID, dbo_DSS_LastStatus.Completion_Name, dbo_DSS_LastStatus.Status, [tbl Petra Current Status Copy].[Sym Code] INTO [tbl Petra and DSS Status]
FROM (dbo_DSS_LastStatus INNER JOIN dbo_DSS_CompletionMaster ON dbo_DSS_LastStatus.PID = dbo_DSS_CompletionMaster.PID) INNER JOIN [tbl Petra Current Status Copy] ON dbo_DSS_CompletionMaster.ParentPID = [tbl Petra Current Status Copy].[UWI (APINum)]
GROUP BY dbo_DSS_LastStatus.PID, dbo_DSS_LastStatus.Completion_Name, dbo_DSS_LastStatus.Status, [tbl Petra Current Status Copy].[Sym Code]
HAVING ((([tbl Petra Current Status Copy].[Sym Code]) Not Like "PA*")) OR ((([tbl Petra Current Status Copy].[Sym Code])<>"P&A"));


More information about the AccessD mailing list