using wildcard in update query

H

hanan

I am trying to update data,
I have tile numbers, but would like to select many tiles at a time.
eg. tile:72e01a01
when i use wildcards to select more than one tile and run the query it
always say 'updating 0 rows'. It DOES work when I type in :
Like "73e01a*"

but NOT if I want more like:
Like "73e01a*" and "73e01b*"
another example that didn't work"
Like "73e01a01" and "73e01a02"
 
O

Ofer Cohen

You want to use Or instead of And

Select * From TableName Where FieldName Like "73e01a*" Or FieldName Like
"73e01b*"

Or, without the wild card
Select * From TableName Where FieldName In ("73e01a01" ,"73e01a02")
 
J

John Spencer

First you need to use OR not AND. No entry in a field is going to be like
both those values at the same time.
Second you will need to include the "like" operator both times.

Criteria: Like "73e01a*" OR Like "73e01b*"

IN an SQL query view that would end up looking something like

WHERE YourField Like "73e01a*" OR YourField Like "73e01b*"

And by the way with like and those values you could use
Like "73e01[ab]*"



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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