Query for Percent Sign ('%') in Field
Using A2003. I tried to query for records that contain a trailing '%'
symbol in a certain field but was unable to get this to work.
Knowing % is a wildcard character I tried substituting the ASCII code
equivalent, but
SELECT * FROM MyTable WHERE MyField LIKE '*' & CHR(37);
returns all records from the table (most of which do not contain the
'%' symbol).
Is there a work-around?
Re: Query for Percent Sign ('%') in Field
On Apr 21, 4:59=A0pm, Smartin <smartin... [at] gmail.com> wrote:
> Using A2003. I tried to query for records that contain a trailing '%'
> symbol in a certain field but was unable to get this to work.
>
> Knowing % is a wildcard character I tried substituting the ASCII code
> equivalent, but
>
> SELECT * FROM MyTable WHERE MyField LIKE '*' & CHR(37);
>
> returns all records from the table (most of which do not contain the
> '%' symbol).
>
> Is there a work-around?
this works in access97
SELECT r
FROM Table1
WHERE r Like "*%"
Re: Query for Percent Sign ('%') in Field
On Apr 22, 8:01=A0am, Roger <lesperan... [at] natpro.com> wrote:
> On Apr 21, 4:59=A0pm, Smartin <smartin... [at] gmail.com> wrote:
>
> > Using A2003. I tried to query for records that contain a trailing '%'
> > symbol in a certain field but was unable to get this to work.
>
> > Knowing % is a wildcard character I tried substituting the ASCII code
> > equivalent, but
>
> > SELECT * FROM MyTable WHERE MyField LIKE '*' & CHR(37);
>
> > returns all records from the table (most of which do not contain the
> > '%' symbol).
>
> > Is there a work-around?
>
> this works in access97
> SELECT r
> FROM Table1
> WHERE r Like "*%"
Thanks for the suggestion (FYI it does not work in A2003 -- the query
returns all rows). I ended up using VBA.