Solved

working with quote

Posted on 2006-10-23
3
188 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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

680 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