Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 27th, 2008, 08:22 PM
Smartin
Guest
 
Posts: n/a
Default 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?
  #2  
Old June 27th, 2008, 08:23 PM
Roger
Guest
 
Posts: n/a
Default Re: Query for Percent Sign ('%') in Field

On Apr 21, 4:59*pm, Smartin <smartin...@gmail.comwrote:
Quote:
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 "*%"
  #3  
Old June 27th, 2008, 08:23 PM
Smartin
Guest
 
Posts: n/a
Default Re: Query for Percent Sign ('%') in Field

On Apr 22, 8:01*am, Roger <lesperan...@natpro.comwrote:
Quote:
On Apr 21, 4:59*pm, Smartin <smartin...@gmail.comwrote:
>
Quote:
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.
>
Quote:
Knowing % is a wildcard character I tried substituting the ASCII code
equivalent, but
>
Quote:
SELECT * FROM MyTable WHERE MyField LIKE '*' & CHR(37);
>
Quote:
returns all records from the table (most of which do not contain the
'%' symbol).
>
Quote:
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.
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles