List:General Discussion« Previous MessageNext Message »
From:Menachem Bazian Date:December 17 2008 11:32pm
Subject:SUMIF
View as plain text  
Hi,

I was wondering if anyone can help me with this syntax. I have three 
tables, INVOICES, CHECKS and CHECK_APPLICATIONS. I need to SUM the 
amounts in CHECK_APPLICATIONS for each invoice IF the check it is 
related to has not been voided. Something like this (in SQL and pseudocode)

SELECT invoices.id, invoices.vendor, invoices.namount AS 
nninvoiceamount, SUM(check_applications.namountapplied IF checks.lvoid=0)

I also need to refer to that SUM in another field.

invoices.namount - SUM(namountapplied we did before) AS namountleft

Any ideas?
Thread
SUMIFMenachem Bazian18 Dec
  • Re: SUMIFPeter Brawley18 Dec