A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Trying to find a single quote (') within text



 
 
Thread Tools Display Modes
  #1  
Old January 8th, 2007, 11:00 PM posted to microsoft.public.access.queries
Ken King
external usenet poster
 
Posts: 18
Default Trying to find a single quote (') within text

We are using an application called MRI on top of MS SQL 2000 database. I am
trying to find a quote character within a text field using like '%'%', but
get the following error message "Error -241721908: 0: Command text was not
set for the command object. (proc: rdoExecSql". How do I find a single
quote in a text field using like?
Ken
  #2  
Old January 8th, 2007, 11:29 PM posted to microsoft.public.access.queries
Gary Walter
external usenet poster
 
Posts: 613
Default Trying to find a single quote (') within text

I assume you use 2 single quotes within single quotes

LIKE '%''%'

"Ken King"wrote:
We are using an application called MRI on top of MS SQL 2000 database. I
am
trying to find a quote character within a text field using like '%'%', but
get the following error message "Error -241721908: 0: Command text was not
set for the command object. (proc: rdoExecSql". How do I find a single
quote in a text field using like?
Ken



  #3  
Old January 9th, 2007, 02:13 AM posted to microsoft.public.access.queries
Smartin
external usenet poster
 
Posts: 192
Default Trying to find a single quote (') within text

Ken King wrote:
We are using an application called MRI on top of MS SQL 2000 database. I am
trying to find a quote character within a text field using like '%'%', but
get the following error message "Error -241721908: 0: Command text was not
set for the command object. (proc: rdoExecSql". How do I find a single
quote in a text field using like?
Ken


Look for CHR(39) (if that's an option).

--
Smartin
  #4  
Old January 9th, 2007, 10:51 AM posted to microsoft.public.access.queries
Gary Walter
external usenet poster
 
Posts: 613
Default Trying to find a single quote (') within text

USE pubs
GO
SELECT au_lname
FROM authors
WHERE au_lname LIKE '%''%'
ORDER by au_lname
GO

returns

O'Leary

"Gary Walter" wrote:
I assume you use 2 single quotes within single quotes

LIKE '%''%'

"Ken King"wrote:
We are using an application called MRI on top of MS SQL 2000 database. I
am
trying to find a quote character within a text field using like '%'%',
but
get the following error message "Error -241721908: 0: Command text was
not
set for the command object. (proc: rdoExecSql". How do I find a single
quote in a text field using like?
Ken





 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.