That query is very strange as it seems to just repeat the exact same criteria
many times. I’ve simplified it below. Also it doesn’t seem to have much to do
with the orginal problem or I’m missing something.
Another possible problem is the use of a reserved word in a table or field
name. In this case “Type†is a reserved word. I put [] around it which should
stop any problems. In the future try to name fields something slightly
different than a reserved word. For example “Note†is a reserved word;
however, your “Notes†isn’t.
http://support.microsoft.com/kb/286335/
SELECT [Development Payments].DonorNo,
[Development Payments].[Type],
[Development Payments].Occurring,
[Development Payments].Amount,
[Development Payments].Duration,
[Development Payments].GA,
[Development Payments].Notes
FROM [Development Payments]
WHERE [Development Payments].[Type] = "S/O"
AND [Development Payments].Occurring IN ("1", "2", "4", "12")
AND [Development Payments].Duration Is Not Null
AND [Development Payments].Notes Not Like "ANOMALY*"
AND [Development Payments].Notes Not Like "not yet received" ;
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
:
Hi Jerry
SELECT [Development Payments].DonorNo, [Development Payments].Type,
[Development Payments].Occurring, [Development Payments].Amount, [Development
Payments].Duration, [Development Payments].GA, [Development Payments].Notes
FROM [Development Payments]
WHERE ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="1") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="1") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="1") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="1") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="1") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="2") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="2") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="2") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="2") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="2") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="2") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="2") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="2") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="2") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="4") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="4") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="4") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="4") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="4") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received")) OR ((([Development Payments].Type)="S/O") AND
(([Development Payments].Occurring)="4") AND (([Development
Payments].Duration) Is Not Null) AND (([Development Payments].Notes) Not Like
"ANOMALY*" And ([Development Payments].Notes) Not Like "not yet received"))
OR ((([Development Payments].Type)="S/O") AND (([Development
Payments].Occurring)="4") AND (([Development Payments].Duration) Is Not Null)
AND (([Development Payments].Notes) Not Like "ANOMALY*" And ([Development
Payments].Notes) Not Like "not yet received")) OR ((([Development
Payments].Type)="S/O") AND (([Development Payments].Occurring)="12") AND
(([Development Payments].Duration) Is Not Null) AND (([Development
Payments].Notes) Not Like "ANOMALY*" And ([Development Payments].Notes) Not
Like "not yet received"));
:
Are you saying that you have created 12 different queries i.e. one for each
month? If so, there must be a better way.
Show us the SQL for one of the queries. Open the query in design view. Next
go to View, SQL View and copy and past it here.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
:
I have created a query for every calendar month that finds unmatched records
for expected receipts, and another query for every calendar month that finds
unmatched records for unexpected receipts. To open up the report to non
Access programmers I placed a date parameter, however this only works when it
is in the primary query when finding the unmatched records. Is there any way
of resolving the other way? it comes up asking for parameters that are not
there!
Or is there a simpler way of getting the same results? It does work with
query searching for 'last months' receipts, but not when changed to a date
parameter