M
MikeB
I'm designing a query using the Design View in Access since I find it
easier than typing the SQL (and making typing errors in table names,
etc.).
I just can't get what I want, so eventually I resort to hand-coding
the WHERE clause in SQL as follows:
WHERE (
(Tournaments.TournamentNumber=[Tournament?])
OR ([Tournament?] Is Null)
)
AND (
(Players.Status=[Status?])
OR ([Status?] Is Null)
)
This gives me exactly what I need.
But when I look at the design for the query, *this* is what I get. I
would *never* have figured out that that was how I had to set the
criteria. http://i36.tinypic.com/1g4r2q.jpg
However, if I make any modifications to the query in design view,
Access rewrites the WHERE clause as follows:
WHERE (((Tournaments.TournamentNumber)=[Tournament?]) AND
((Players.Status)=[Status?])) OR (((Players.Status)=[Status?]) AND
(([Tournament?]) Is Null)) OR (((Tournaments.TournamentNumber)=
[Tournament?]) AND (([Status?]) Is Null)) OR ((([Tournament?]) Is
Null) AND (([Status?]) Is Null))
Just for kicks, I "structured" this to see what it looks like and this
is what I came up with:
WHERE
(
(
(Tournaments.TournamentNumber)=[Tournament?]
)
AND
(
(Players.Status)=[Status?]
)
)
OR
(
(
(Players.Status)=[Status?]
)
AND
(
([Tournament?]) Is Null
)
)
OR
(
(
(Tournaments.TournamentNumber)=[Tournament?]
)
AND
(
([Status?]) Is Null
)
)
OR
(
(
([Tournament?]) Is Null
)
AND
(
([Status?]) Is Null
)
)
Can anyone shed light on this? I'm completely stupid here.
easier than typing the SQL (and making typing errors in table names,
etc.).
I just can't get what I want, so eventually I resort to hand-coding
the WHERE clause in SQL as follows:
WHERE (
(Tournaments.TournamentNumber=[Tournament?])
OR ([Tournament?] Is Null)
)
AND (
(Players.Status=[Status?])
OR ([Status?] Is Null)
)
This gives me exactly what I need.
But when I look at the design for the query, *this* is what I get. I
would *never* have figured out that that was how I had to set the
criteria. http://i36.tinypic.com/1g4r2q.jpg
However, if I make any modifications to the query in design view,
Access rewrites the WHERE clause as follows:
WHERE (((Tournaments.TournamentNumber)=[Tournament?]) AND
((Players.Status)=[Status?])) OR (((Players.Status)=[Status?]) AND
(([Tournament?]) Is Null)) OR (((Tournaments.TournamentNumber)=
[Tournament?]) AND (([Status?]) Is Null)) OR ((([Tournament?]) Is
Null) AND (([Status?]) Is Null))
Just for kicks, I "structured" this to see what it looks like and this
is what I came up with:
WHERE
(
(
(Tournaments.TournamentNumber)=[Tournament?]
)
AND
(
(Players.Status)=[Status?]
)
)
OR
(
(
(Players.Status)=[Status?]
)
AND
(
([Tournament?]) Is Null
)
)
OR
(
(
(Tournaments.TournamentNumber)=[Tournament?]
)
AND
(
([Status?]) Is Null
)
)
OR
(
(
([Tournament?]) Is Null
)
AND
(
([Status?]) Is Null
)
)
Can anyone shed light on this? I'm completely stupid here.