Morning everyone
I currently have a sheet which calculates our customers' spend sorted by customer then by rep then week.
This bit is working fine, I use an MS Query to fetch in all the jobs we have done so far this year. This list is getting a bit large already (30000+ rows) and I can shrink this a bit by omitting several house account codes an one particular customer which is large and we measure seperately.
I tried to use the wizard within MS Query to get it to list all job so far this year without a few account codes.
The code looks like this:
SELECT
However it still lists jobs for the accounts GWT, ZZPAL and so on. It's as if excel is ignoring the last part of the Where statement, or else I've got my logic wrong.
Have I got my AND's and OR's mixed up?
Thanks in advance
I currently have a sheet which calculates our customers' spend sorted by customer then by rep then week.
This bit is working fine, I use an MS Query to fetch in all the jobs we have done so far this year. This list is getting a bit large already (30000+ rows) and I can shrink this a bit by omitting several house account codes an one particular customer which is large and we measure seperately.
I tried to use the wizard within MS Query to get it to list all job so far this year without a few account codes.
The code looks like this:
SELECT
WALKER_HAJobFile.JobNumber,
WALKER_HAJobFile.Account,
WALKER_HAJobFile.Volume,
WALKER_HAJobFile.Quantity,
WALKER_HAJobFile.Value1,
WALKER_HAJobFile.DelDate,
WALKER_HAJobFile.JobCancelled,
WALKER_HAJobFile.DelPostCode
FROM DBA.WALKER_HAJobFile WALKER_HAJobFile
WHERE(WALKER_HAJobFile.DelDate Between {d '2013-01-01'} And {d '2013-12-31'} )
AND(WALKER_HAJobFile.JobCancelled='N')
AND(
(WALKER_HAJobFile.Account<>'BABY') OR
(WALKER_HAJobFile.Account<>'EVERB') OR
(WALKER_HAJobFile.Account<>'ROLF') OR
(WALKER_HAJobFile.Account<>'ZZPAL') OR
(WALKER_HAJobFile.Account<>'GWT')
)
ORDER BY WALKER_HAJobFile.DelDateHowever it still lists jobs for the accounts GWT, ZZPAL and so on. It's as if excel is ignoring the last part of the Where statement, or else I've got my logic wrong.
Have I got my AND's and OR's mixed up?
Thanks in advance