Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Msandlana
Starting Member
33 Posts |
Posted - 2008-01-21 : 06:33:38
|
| I want to get the records on person table by emailaddress but there is a problem with this statement It works only when I select all the value. Its shows this error "Unclosed quotation mark after the character string ''."If (@varEmailAddress <> '')Begin Set @varSelectSql = @varSelectSql + ' And A.EmailAddress like ' + '%' + cast(@varEmailAddress as varchar(100))+ '%'''End |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-01-21 : 06:37:05
|
[code]IF COALESCE(@varEmailAddress, '') > '' SET @varSelectSql = @varSelectSql + ' AND a.EmailAddress LIKE ''%' + @varEmailAddress + '%'''[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Msandlana
Starting Member
33 Posts |
Posted - 2008-01-21 : 07:20:23
|
| Thank you |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-01-21 : 08:34:37
|
| Apply this logicwww.sommarskog.se/dyna-search.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|