where a.system_nr =''''5300'''' and
a.external_status_cd = '''''''' and
a.cust_acct_id = b.rel_cust_acct_id and
b.cust_acct_id = c.cust_acct_id and
c.cust_acct_id = d.cust_acct_id and
d.acct_status_cd = ''''OPEN'''' and
d.time_mnth_gen_id =''''' + @BegDate + ''''' and
a.cust_acct_id = e.cust_acct_id and
e.tran_dt >=''''' + @BegDate + ''''' and
e.tran_dt<=''''' + @EndDate + ''''' and
d.portfolio_cd = ''''HEQ'''' and
a.time_mnth_gen_id =''''' + @BegDate + ''''' '')'
這裏是where條件已經寫好,我需要進行更改。Toad和SQL Server 2005
你能告訴我他們爲什麼使用'''''[email protected]'''''
?我可以使用'+Bedate'
嗎? 我的意思是他們爲什麼每面都使用'''''
?
因爲列值中包含單引號? – 2011-04-18 06:28:15
我懷疑你認爲構建動態查詢的完整語句太大而不能包含在你的問題中。但是在完整版本中顯示哪對引號包含了什麼會容易得多。不過,基本上答案是:它與引用引號字符(''')有關。 – 2011-04-18 07:58:31