S
Stephen Lynch
Help, I cannot figure this out.
I have a group by query and I am having problems with multiple OR
statements. When I save the query it puts each parameter on a seperate line
and then it doesn't work properly.
My parameter criteria is: Not Like "*9303*" Or Not Like ";S1C *" on field
Comments with another parameter of "wdl" on TransactionCode.
After I save, It drops each criteria to a seperate line and the results come
out wrong.
Here's what I start with that works;
SELECT tblTransactions.AccNumber, tblTransactions.FileDate AS CurrentDate,
tblPlans.PlanName, Sum(tblTransactions.DollarAmt) AS SumOfDollarAmt
FROM tblPlans INNER JOIN tblTransactions ON tblPlans.[SchwabAccNo] =
tblTransactions.AccNumber
WHERE (((tblTransactions.Comments) Not Like "*9303*" Or
(tblTransactions.Comments) Not Like ";S1C *") AND
((tblTransactions.TransactionCode)="wdl"))
GROUP BY tblTransactions.AccNumber, tblTransactions.FileDate,
tblPlans.PlanName
ORDER BY tblTransactions.FileDate DESC , tblPlans.PlanName;
Here's what it converts it to on save:
SELECT tblTransactions.AccNumber, tblTransactions.FileDate AS CurrentDate,
tblPlans.PlanName, Sum(tblTransactions.DollarAmt) AS SumOfDollarAmt
FROM tblPlans INNER JOIN tblTransactions ON tblPlans.[SchwabAccNo] =
tblTransactions.AccNumber
WHERE (((tblTransactions.Comments) Not Like "*9303*") AND
((tblTransactions.TransactionCode)="wdl")) OR (((tblTransactions.Comments)
Like ";S1C *") AND ((tblTransactions.TransactionCode)="wdl"))
GROUP BY tblTransactions.AccNumber, tblTransactions.FileDate,
tblPlans.PlanName
ORDER BY tblTransactions.FileDate DESC , tblPlans.PlanName;
I have a group by query and I am having problems with multiple OR
statements. When I save the query it puts each parameter on a seperate line
and then it doesn't work properly.
My parameter criteria is: Not Like "*9303*" Or Not Like ";S1C *" on field
Comments with another parameter of "wdl" on TransactionCode.
After I save, It drops each criteria to a seperate line and the results come
out wrong.
Here's what I start with that works;
SELECT tblTransactions.AccNumber, tblTransactions.FileDate AS CurrentDate,
tblPlans.PlanName, Sum(tblTransactions.DollarAmt) AS SumOfDollarAmt
FROM tblPlans INNER JOIN tblTransactions ON tblPlans.[SchwabAccNo] =
tblTransactions.AccNumber
WHERE (((tblTransactions.Comments) Not Like "*9303*" Or
(tblTransactions.Comments) Not Like ";S1C *") AND
((tblTransactions.TransactionCode)="wdl"))
GROUP BY tblTransactions.AccNumber, tblTransactions.FileDate,
tblPlans.PlanName
ORDER BY tblTransactions.FileDate DESC , tblPlans.PlanName;
Here's what it converts it to on save:
SELECT tblTransactions.AccNumber, tblTransactions.FileDate AS CurrentDate,
tblPlans.PlanName, Sum(tblTransactions.DollarAmt) AS SumOfDollarAmt
FROM tblPlans INNER JOIN tblTransactions ON tblPlans.[SchwabAccNo] =
tblTransactions.AccNumber
WHERE (((tblTransactions.Comments) Not Like "*9303*") AND
((tblTransactions.TransactionCode)="wdl")) OR (((tblTransactions.Comments)
Like ";S1C *") AND ((tblTransactions.TransactionCode)="wdl"))
GROUP BY tblTransactions.AccNumber, tblTransactions.FileDate,
tblPlans.PlanName
ORDER BY tblTransactions.FileDate DESC , tblPlans.PlanName;