473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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?
Jun 27 '08 #1
2 6026
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MX1 | last post by:
Hi all, I've setup a table with one field that will hold percent values. The type is number and the format is percent on the field. When I do data entry directly into the field, I have to put...
1
by: Terencetrent | last post by:
I am trying to format a query expression drawn from a dialog box as percent. The original statement to get the value for the query is as follows: New%markup: !! The dialog box looks the...
1
by: Alan Lane | last post by:
Hello world: I'm having trouble finding how to escape the percent sign ("%") from a SQL query so that it will show up in an Access report. Here's my SQL string ... '--Build SQL String...
2
by: mhodkin | last post by:
I created a query in which I have grouped data by City. I wish to calculate the percent of each value, e.g. City/(Total count of all Cities), in tbe next column of the query. I can't seem to...
8
by: Bri | last post by:
Greetings, I am using Eval() in a query with only limited success. If the text within the function contains a reference to a Field I get #ERROR#. I'll try and explain what I'm trying to do and...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
13
by: stephen | last post by:
Hi all. How do I escape the "%" sign in a print statement so that it prints? Thanks. Stephen
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
2
by: sara | last post by:
I am helping a non-profit track their elder clients and care given to the clients. The organization would like a report that shows various info on ALL clients, such as: # in each town, # and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.