Filter Records with a space at the beginning

  • Thread starter Thread starter glen
  • Start date Start date
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
 
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
 
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
 
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!
 
Back
Top