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 |
|
fuzzyip
Starting Member
35 Posts |
Posted - 2008-08-06 : 16:32:49
|
| selectcarcat = CASE WHEN name LIKE '%Acura%' and '%CL%' then 'Coupe'WHEN name LIKE '%Acura%' and '%Integra 2dr%' then 'Coupe'WHEN name LIKE '%Acura%' and '%Integra 4dr%' then 'Sedan'else unknown endis coming up with the following errorMsg 4145, Level 15, State 1, Line 3An expression of non-boolean type specified in a context where a condition is expected, near 'then'. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Van
Constraint Violating Yak Guru
462 Posts |
Posted - 2008-08-06 : 17:00:35
|
| Couldn't you also do this:WHEN name LIKE '%Acura%CL%' THEN 'Coupe'Of course if the 'CL' came before 'Acura' then it wouldn't work. |
 |
|
|
|
|
|