List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:December 17 2008 11:37pm
Subject:Re: SUMIF
View as plain text  
Menachem,

 > SUM(check_applications.namountapplied IF checks.lvoid=0)

Close. Try SUM(IF(checks.lvoid=0,0,check_applications.namountapplied))

PB

-----

Menachem Bazian wrote:
> 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,
> I also need to refer to that SUM in another field.
>
> invoices.namount - SUM(namountapplied we did before) AS namountleft
>
> Any ideas?
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.176 / Virus Database: 270.9.19/1853 - Release Date: 12/17/2008 8:31 AM
>
>   

Thread
SUMIFMenachem Bazian18 Dec
  • Re: SUMIFPeter Brawley18 Dec