By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

Query for Percent Sign ('%') in Field

P: n/a
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?
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 21, 4:59*pm, Smartin <smartin...@gmail.comwrote:
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 "*%"
Jun 27 '08 #2

P: n/a
On Apr 22, 8:01*am, Roger <lesperan...@natpro.comwrote:
On Apr 21, 4:59*pm, Smartin <smartin...@gmail.comwrote:
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.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.