Hello:
I have a Set Field active link action which is using direct sql to get a sum of difference between two fields. The sql statement is something like below: Select SUM ((C3 - C901001003)/60 ) from T573 Where C901001003 >= $Start Date_int$ AND C901001003 <= $End Date_int$ AND C901002104 IS NOT NULL AND C901002116 NOT LIKE 'SALES%' $Product Criteria$ 'Product Criteria' is a character field which will be set dynamically base on user action. I also have a Set Field action to 'build Product Criteria': " AND C300088000 = " + " '"+ $Product Name$ + "' " The goal is to generate a sql statement like below: Select SUM ((C3 - C901001003)/60 ) from T573 Where C901001003 >= 1154059200 AND C901001003 <= 1217217600 AND C901002104 IS NOT NULL C901002116 NOT LIKE 'SALES%' AND C300088000 = 'HUB LINE CARD' But when I run the report I got sql error: "Failure during SQL operation to the database : Line 1: Incorrect syntax near 'Hub LINE CARD'." When I check the database log, I saw system added a set of single quote round 'HUB LINE CARD', the database log show the sql as Select SUM ((C3 - C901001003)/60 ) from T573 Where C901001003 >= 1154059200 AND C901001003 <= 1217217600 AND C901002104 IS NOT NULL C901002116 NOT LIKE 'SALES%' AND C300088000 = ''HUB LINE CARD'' In Active link log, the value of 'Product Criteria' is: AND C300088000 = 'HUB LINE CARD' , I don't know why system would add a set of single quote just around 'HUB LINE CARD'. We are using SQL server 2000. Please help!!! Hui </PRE><BR><span style='font-size:8.0pt;font-family:"Arial","sans-serif";color:#003366'> _____________________________________________________<BR> This electronic message and any files transmitted with it contains<BR> information from iDirect, which may be privileged, proprietary<BR> and/or confidential. It is intended solely for the use of the individual<BR> or entity to whom they are addressed. If you are not the original<BR> recipient or the person responsible for delivering the email to the<BR> intended recipient, be advised that you have received this email<BR> in error, and that any use, dissemination, forwarding, printing, or<BR> copying of this email is strictly prohibited. If you received this email<BR> in error, please delete it and immediately notify the sender.<BR> _____________________________________________________ </SPAN><PRE> _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"