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 |
|
DaveBF
Yak Posting Veteran
89 Posts |
Posted - 2012-08-22 : 07:59:23
|
| I'm trying to use the label defined using AS in a WHERE clause. Is there any way to do that? This says "Invalid Column Name 'EmpStatus'".This is a simplified version of the query.select case when New=1 then 'New Employee' when New=0 then 'Old Employee' else 'Employee' end As EmpStatusfrom Personwhere EmpStatus like '%' |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-08-22 : 08:13:26
|
[code]select *from(select case when New=1 then 'New Employee' when New=0 then 'Old Employee' else 'Employee' end As EmpStatusfrom Person) as Dwhere EmpStatus like '%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
DaveBF
Yak Posting Veteran
89 Posts |
Posted - 2012-08-22 : 08:38:58
|
| Thank you. That worked. I wouldn't have figured this out myself. |
 |
|
|
|
|
|