I'm trying to create a new variable base on existing variable, BuyerID, using case-when statement. However, the query I have doesn't work. Could anyone please help? Part of the query and error message are below.
*************************
case
when BuyerID='Null' then 1
else 0
end
as BuyerCount
**************************
**************************
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
*************************
case
when BuyerID='Null' then 1
else 0
end
as BuyerCount
**************************
**************************
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.