Filter Records with a space at the beginning

G

glen

I have a field with text. Some of the data begins with a blank space
and some does not. I am trying to use a query to filter the data that
begins with a character and not a space.
the field may contain " XYZ abc" this has a space at the beginning.
Another record may have "XYZ abc " It has no space at the beginning.
How do I find the one with NO space at the beginning?

Thanks
 
J

John W. Vinson

I have a field with text. Some of the data begins with a blank space
and some does not. I am trying to use a query to filter the data that
begins with a character and not a space.
the field may contain " XYZ abc" this has a space at the beginning.
Another record may have "XYZ abc " It has no space at the beginning.
How do I find the one with NO space at the beginning?

Thanks

A criterion of

LIKE "[! ]*"

will find all records where the first character is not blank. Remove the ! to
find all records where it IS blank.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
J

John Spencer

Gee, let's add one more method.

You can use
NOT Like " *"
as the criteria

Or use
LIKE "[0-9A-z]*"

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
G

glen

I have a field with text. Some of the data begins with a blank space
and some does not. I am trying to use a query to filter the data that
begins with a character and not a space.
the field may contain " XYZ abc" this has a space at the beginning.
Another record may have "XYZ abc " It has no space at the beginning.
How do I find the one with NO space at the beginning?

Thanks

Thanks Guys That hellped a lot. Very gratefull!
 

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