Query for Percent Sign ("%") in Field

Query for Percent Sign ("%") in Field

am 22.04.2008 00:59:43 von Smartin

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

am 22.04.2008 14:01:28 von Roger

On Apr 21, 4:59=A0pm, Smartin 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

am 22.04.2008 15:48:27 von Smartin

On Apr 22, 8:01=A0am, Roger wrote:
> On Apr 21, 4:59=A0pm, Smartin 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.