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)
 left outer join AND IIF STATEMENT

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2011-05-26 : 03:19:42
Hi,
below i have select statement ,i have joined two tables in ht_booknew i have a data but invoice table i don't have data, i want to change null to '0' in the value

example
1, null,null instead of null either i have to get invoice number or '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'


Desikankannan

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-05-26 : 03:35:26
[code]
SELECT ht_booknew.book_id, invoice.dinid, isnull(invoice.dinvoiceno, '0')
[/code]


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

Go to Top of Page
   

- Advertisement -