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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-10 : 08:15:12
Greg writes "Would like to know if this Iif Statement will execute successfully.

SELECT Groups.GroupName,
Iif(GroupName= Null, 'Unassigned','GroupName') ,FROM Groups

I RECEIVE AN ERROR:-
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-10 : 08:27:40
Select GroupName,
CASE when GroupName is Null then 'Unassigned' else GroupName end as NewCol
from Groups

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -