Like criteria

  • Thread starter Thread starter vp
  • Start date Start date
V

vp

I created a query which filters a column containing always text with 7
characters.
The criteria is ( Like "*X" ). It keeps all the rows which has the last
character as X.
I saved the query with a name.
The query returns the found rows when used from the inside the database.

But this query does not return any data if imported in Excel for simle
import of data or in Word for the purpose of mail merge; that is when opened
from outside its database.
It seems that Like criteria is not working when used from outside the
database.

I did not tryed something else. It is interesting to know why is that, what
is wrong and what workaround is suggested.

Thank you
 
I tried
Like "%X"
and no data was retrieved , even in the current database.

You're speaking the wrong dialect of SQL for Access. % is the "match any
string" wildcard in SQL/Server; in JET/ACE (Access) databases the wildcard you
want is *.

LIKE "*X"

will return all records where the field ends in X.

To find all records where the field contains X anywhere within it use

LIKE "*X*"
 
I use mail merge from Word with the results of a chain of aprox 10 queries
in cascade. In the first queries I use Like "*X" criteria. I need it as *X
not *X*.

I think I can't replicate all the cascadeted queries in Word. So I need to
get the data out of the database, somehow, preferably with no manual
intervention.
 
Back
Top