wild card request in union query

  • Thread starter Thread starter Sue Dorsey
  • Start date Start date
S

Sue Dorsey

Hello. I set up a union query for about a dozen tables.
When I try to enter request as *partial name* I get no
records. Are wild cards not to be used with a query or
union query? Thanks for any suggestions.
 
Union queries will support wild cards. Can you post your SQL text?

It is really hard to decide what may be wrong with the information you have provided.
 
Below is one of my union queries. None of the three union
queries seem to allow me to use wild cards * or ? Query
is for species.

select[species],[number],[first date],[last date],
[location],[county], [observers]
from [bird2002sightings]
WHERE (((bird2002sightings.Species)=[Enter a Species]));

union select[species],[number],[first date],[last date],
[location],[county],[observers]
from [bird2001sightings]
WHERE (((bird2001sightings.Species)=[Enter a Species]))

UNION select[species],[number],[first date],[last date],
[location],[county],[observers]
from [bird2000sightings]
WHERE (((bird2000sightings.Species)=[Enter a Species]))
ORDER BY [First Date];
 
Well, since you don't use the like operator, I don't see how you could complain.

Try to replace the = operator with the Like operator. Also, the semi-colons
could be interferring with a successful query.

select[species],[number],[first date],[last date],
[location],[county], [observers]
from [bird2002sightings]
WHERE (((bird2002sightings.Species) LIKE [Enter a Species]))

union select[species],[number],[first date],[last date],
[location],[county],[observers]
from [bird2001sightings]
WHERE (((bird2001sightings.Species) LIKE [Enter a Species]))

UNION select[species],[number],[first date],[last date],
[location],[county],[observers]
from [bird2000sightings]
WHERE (((bird2000sightings.Species)LIKE [Enter a Species]))
ORDER BY [First Date];
 
Thanks much for the help. Like works fine. I did not
know that I could use "like" instead of =. I took the sql
for union queries from the help files supplied with
Access. The semicolon does not seem to bother the query.
If fact, when I left it off, the query did not work the
way I wanted.
Thanks again.
 
Back
Top