Question : I want to use the sum by IFF Function by using a criteria

Hi, can I use a iff funcion for summing the values for a specifi criteria.

In the example provided, I sum all the sources by CSCC, but also I would like to add a criteria that do the same thing using a criteria Quotes_Status = 'QC' which means that I am going to sum all records that match this creiterias.
Thanks
Code Snippet:
1:
CSCC: Sum(IIf([Created By Source]="CSCC",1,0))

Answer : I want to use the sum by IFF Function by using a criteria

I got my solution
1:
2:
3:
SELECT Sum(IIf([Created By Source]="CSCC",1,0)) AS [CSCC-Quotes], Sum(IIf([QuotesFile]![Created By Source]='CSCC' And [QuotesFile]![Quote Status]='QC',1,0)) AS [CSCC-Orders], Sum(IIf([Created By Source]="IQT",1,0)) AS [IQT-Quotes], Sum(IIf([QuotesFile]![Created By Source]='IQT' And [QuotesFile]![Quote Status]='QC',1,0)) AS [IQT-Orders], Sum(IIf([Created By Source]="SCC",1,0)) AS [SCC-Quotes], Sum(IIf([QuotesFile]![Created By Source]='SCC' And [QuotesFile]![Quote Status]='QC',1,0)) AS [SCC-Orders]
FROM QuotesFile
WHERE (((QuotesFile.[Creation Date]) Between #1/11/2007# And #11/30/2007#));
Random Solutions  
 
programming4us programming4us