wild card request in union query

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.
 
J

John Spencer (MVP)

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.
 
S

suedorsey

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];
 
J

John Spencer (MVP)

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];
 
S

Sue Dorsey

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top