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)
 if esle statement

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2011-09-07 : 00:13:55
Hi,

i have field reqty what i need is that if reqqty > 0 then i need to show true if reqqty is 0 i need to false i need to change this
isnull(tbdcinvoice.reqqty,0) as sel ,below query first field

"select isnull(tbdcinvoice.reqqty,0) as sel, tblincomegrn .grnid, tblincomegrn.grncode,tblincomegrn.idcno,tblincomegrndetail.pctrlno,(select pcode from tblPrdMst where Pctrlno = tblincomegrndetail.Pctrlno) as pcode, tblincomegrndetail.prdqty as bqty , isnull(tbdcinvoice.reqqty,0) as reqqty,'0' as balanceqty ,'Y' as sflag from tblincomegrn inner join tblincomegrndetail on tblincomegrn.grnid = tblincomegrndetail.grnid LEFT JOIN tbdcinvoice on tblincomegrndetail.grnid = tbdcinvoice.grnid and tblincomegrndetail.pctrlno = tbdcinvoice.pctrlno

Desikankannan

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-07 : 00:16:45
use like:-
case when isnull(tbdcinvoice.reqqty,0) <> 0 then 'true' else 'false' end

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -