Skip to Content
0

Crystal Report bypass Single qoute

Mar 03, 2017 at 08:19 AM

98

avatar image

Good Day,

Please help me expert I cant show the transaction base on my parameter when the customer code has a single qoute like C_Samantha's

this is my parameter:

Reference@ Select JDT1.Ref1 From JDT1 where (JDT1.Shortname='@Customer') and ( (JDT1.BalDueDeb - JDT1.BalDueCred)<>0)

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Taseeb Saeed Mar 06, 2017 at 05:02 AM
0

Hello,

Update your parameter with following

Reference@ Select JDT1.Ref1 From JDT1 where (REPLACE(JDT1.Shortname,'''','') =REPLACE('@Customer','''','')) and ( (JDT1.BalDueDeb - JDT1.BalDueCred)<>0)

Thanks

Regards,

Engr. Taseeb Saeed

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Thanks Engr. Taseeb,

But cant get the best result. All CardCode has single qoute('), there's nothing appear in select box.

Regards and Thanks

0
Ian Waterman Mar 03, 2017 at 10:26 AM
0

You could try removing '

Replace(JDT1.Shortname, "'","")

Ian

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Ian,

How can apply that could? like

Reference@ Select JDT1.Ref1 From JDT1 where

(Replace(JDT1.Shortname, "'","") = '@Customer') and ( (JDT1.BalDueDeb - JDT1.BalDueCred)<>0)
??

Thanks

0

Still cant get the answer.

Thanks

0
Johan Hakkesteegt Mar 07, 2017 at 07:21 AM
0

Hi,

In general it is not recommended to use single or double quotes in identifier type fields (CardCode, CardName, ItemCode, ItemName, etc). If necessary try to use accents instead: ´´. Looks the same but does not cause problems in queries, Crystal Reports, and on web pages.

Regards,

´Johan´

Share
10 |10000 characters needed characters left characters exceeded