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 |
|
crsri
Starting Member
1 Post |
Posted - 2009-08-26 : 19:22:01
|
| Below is my query,CHARINDEX(B.PHONEBUILD+'_',A.JOBNAME)>0The above statement gives all the phonebuild which matches with jobname and have '_' in the jobnameeg results:PhoneBuild JobnameQ6270BKPRQL136022 Q6270BKPRQL136022_11JUL2009_002854amQ6270BKPDZL136022 Q6270BKPDZL136022_11JUL2009_003046ami am looking for the phonebuild which are exact match with jobname,something like belowPhoneBuild JobnameQ6270BKPRQL136022 Q6270BKPRQL136022Q6270BKPDZL136018 Q6270BKPDZL136018Please Help |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-08-26 : 23:13:39
|
[code]select *from yourtablewhere PhoneBuild = left(Jobname, len(PhoneBuild))[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-27 : 01:41:46
|
| select *from yourtablewhere Jobname like PhoneBuild+'%'MadhivananFailing to plan is Planning to fail |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-08-27 : 02:10:49
|
| You can try sub string tooselect *from yourtablewhere PhoneBuild = substring( Jobname,0,charindex('_', Jobname))Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
|
|
|