Hello,
I have some SQL code that doesn't seem to be working for a crosstab query. I have a join on two tables, and in the code below, the "Not Like "NANG"" statement works just fine, while the "Not Like "ALTCRG"" statement is not working at all. Any ideas where this might go wrong? All companies are listed in the Company groups table with their associated groups, and Company is a primary key in that table.
I have some SQL code that doesn't seem to be working for a crosstab query. I have a join on two tables, and in the code below, the "Not Like "NANG"" statement works just fine, while the "Not Like "ALTCRG"" statement is not working at all. Any ideas where this might go wrong? All companies are listed in the Company groups table with their associated groups, and Company is a primary key in that table.
Code:
TRANSFORM Sum([Pivot Query].Amount) AS SumOfAmount
SELECT [Pivot Query].Company, [Pivot Query].Type
FROM [Pivot Query] INNER JOIN [Company Groups] ON [Pivot Query].Company = [Company Groups].Company
WHERE ((([Pivot Query].Type)<>"ALR") AND (([Company Groups].Group) Not Like "NANG")) OR ((([Pivot Query].Type)<>"ALR") AND (([Company Groups].Group) Not Like "ALTCRG"))
GROUP BY [Pivot Query].Company, [Pivot Query].Type
ORDER BY [Pivot Query].Company, [Pivot Query].[Statement Date]
PIVOT [Pivot Query].[Statement Date];