Solved

working with quote

Posted on 2006-10-23
3
189 Views
Last Modified: 2011-10-03
Hello guys,

I am having some  trouble to create a string this way

Str = 'Select * from table where field='' september" '

 Month := QuotedStr('' " '') + month_alias[StrToInt(Copy(Std[I],5,2))-1] + QuotedStr('' " '')

I tried several ways, but nothing so far

As you can see, I have a double quote in september

Thanks
0
Comment
Question by:hidrau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17788982
the way to use quotedstr is:
month:= quotedstr( month_alias[StrToInt(Copy(Std[I],5,2))-1] );
which will result in 'september' for example
if you wan it to put in that select then use:

str:=quotedstr('Select * from table where fieId="+month_alias[StrToInt(Copy(Std[I],5,2))-1]+"')

though in this particular case of yours, I don't really see the need of quotedstr as you do not use single quotes in the string.
0
 
LVL 28

Accepted Solution

by:
2266180 earned 500 total points
ID: 17789002
also keep in mind that
str:=quotedstr('Select * from table where fieId="+month_alias[StrToInt(Copy(Std[I],5,2))-1]+"')
will result in  'Select * from table where fieId="september"' WITH single quotes. in delphi that would be written as a constant
'''Select * from table where fieId="september"''' (see 3 single quotes at begining and end that represent 1 escaped single quote and a single quote so tha final string will actually contain a single quote at the beginig and end of the string. I am sure you don't want this ... but then again, you know better)
0
 
LVL 1

Author Comment

by:hidrau
ID: 17789021
Thanks very much ciuly
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question