Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

working with quote

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
Avatar of 2266180
2266180
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hidrau

ASKER

Thanks very much ciuly