titans4771
MIS
I have the below select statement:
Select o.orderid,
firstname,
'SUPERVISOR' = MAX(CASE when userdefinedfieldid = 83 and userdefinedanswer = 'Yes' then 'Y'
ELSE 'N' END),
Where SUPERVISOR = 'N'
I get the following error:
Invalid column name 'SUPERVISOR'
even if I enter it like this:
MAX(CASE when userdefinedfieldid = 83 and userdefinedanswer = 'Yes' then 'Y'
ELSE 'N' END) as supervisor
I still get the same error. How can I alias column names or formulas and be able to use them in a where clause?
Thanks!!
Select o.orderid,
firstname,
'SUPERVISOR' = MAX(CASE when userdefinedfieldid = 83 and userdefinedanswer = 'Yes' then 'Y'
ELSE 'N' END),
Where SUPERVISOR = 'N'
I get the following error:
Invalid column name 'SUPERVISOR'
even if I enter it like this:
MAX(CASE when userdefinedfieldid = 83 and userdefinedanswer = 'Yes' then 'Y'
ELSE 'N' END) as supervisor
I still get the same error. How can I alias column names or formulas and be able to use them in a where clause?
Thanks!!