how do i check a field for spaces in a query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I create a report that gives me only the records that have spaces in
the address field? I tried "" and IsNull and no records were put to the
report. When I used <>"" I did get all records that had data in the address
field. Is there some other way to set the citeria equal to spaces?
 
SELECT tblTest.TestText
FROM tblTest
WHERE (((tblTest.TestText) Like "*" & " " & "*"));

Replace 'tblTest' with the name of your table, and 'TestText' with the name
of your field.
 
How can I create a report that gives me only the records that have spaces in
the address field? I tried "" and IsNull and no records were put to the
report. When I used <>"" I did get all records that had data in the address
field. Is there some other way to set the citeria equal to spaces?

Are you searching for *SPACES* - for instance an address like
"Ballacraine" would have no spaces, while "212 W Main" would? OR are
you looking for records with nothing in the Address field? I'm
guessing the latter: if so use a criterion of

IS NULL

It's two words - IsNull() is a VBA function which is a bit different.

John W. Vinson[MVP]
 

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

Back
Top