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 |
|
rcr69er
Constraint Violating Yak Guru
327 Posts |
Posted - 2007-11-26 : 06:16:22
|
| HiI am trying to find a way of finding if the value in one field exists in another.I am using the following query which doesnt seem to be giving the correct result.SELECT Forenames ,CompanyFROM DetailsWHERE Forenames LIKE [Company] + '%' Does anyone have any other solutionsThanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-26 : 06:18:03
|
| SELECT Forenames,CompanyFROM DetailsWHERE Forenames LIKE '%' + [Company] + '%' Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
rcr69er
Constraint Violating Yak Guru
327 Posts |
Posted - 2007-11-26 : 06:24:41
|
| HiThanks for that, When running the query I'm still getting cases where there is a value in the forename column but no value in the company column. |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2007-11-26 : 06:46:37
|
| Add And Company is not null. |
 |
|
|
|
|
|