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 2008 Forums
 Transact-SQL (2008)
 iif case in select statement

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2011-05-26 : 02:54:33
Hi,

i try to work with iif satement my out put is
19 NULL NULL
but i want to the output like
19 0 0


SELECT ht_booknew.book_id, invoice.dinid, invoice.dinvoiceno
FROM ht_booknew LEFT JOIN
invoice ON ht_booknew.book_id = invoice.book_id
where ht_booknew.tripstatus = 'Y'

my out put
19 NULL NULL

but i need to get
19 0 0

Desikankannan

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-05-26 : 04:01:34
dup of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=161062


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -