hello i m developing application in vb 6 and sql server 7
i want to retrive sum of amount from my salesvoucher table so my query is
select sum(amount) from Salesvoucher
whene there r no data in my table then it returns NULL and need to check that . i m checking that in following ways
curAmount=iif(ISNULL(rsSales(0))=true,0,rsSales(0))
but i dont want to check out this explicitly for that i used case in select statement but still it returns NULL so Plz give me some
suggetion on query or tell me any other way to do it
my case query
select case sum(Amount) when NULL then 0 else sum(Amount) end as Amount from salesvoucher
plz help me because i need it in all my procedure and function
i want to retrive sum of amount from my salesvoucher table so my query is
select sum(amount) from Salesvoucher
whene there r no data in my table then it returns NULL and need to check that . i m checking that in following ways
curAmount=iif(ISNULL(rsSales(0))=true,0,rsSales(0))
but i dont want to check out this explicitly for that i used case in select statement but still it returns NULL so Plz give me some
suggetion on query or tell me any other way to do it
my case query
select case sum(Amount) when NULL then 0 else sum(Amount) end as Amount from salesvoucher
plz help me because i need it in all my procedure and function