Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
error on word 'when'
------------------------------------------------
SQL
select distinct kala.code,kala.name,
 
       sum(case when (dbo.tblInvVoucher.VType = 'ran')
                then dbo.tblInvArticle.Amount
            end) as رسید,
             
            sum(case when (dbo.tblInvVoucher.VType = 'han')
                then dbo.tblInvArticle.Amount
            end) as حواله
      
     ,sum(case when (dbo.tblInvVoucher.VType = 'mda')
                then dbo.tblInvArticle.Amount
            end) as [موجودی اولیه]
        
from dbo.tblInvArticle,dbo.tblInvVoucher,kala
where tblInvArticle.VId=tblInvVoucher.VId and kala.code=tblInvArticle.GoodId and FYear='1392'
group by code,name
Posted

Probably, you're looking for IIF[^] function.
 
Share this answer
 
Hi Mohammed,

You can try with iif funtion as Maciej said while converting sql to access.
iif([S].[Gender] = 1,'Male',iif([S].[Gender]=2,'Female','Other')) as [Gender]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900