Re: writing formula for Access



On 9 Feb 2006 19:12:17 -0800, Levi wrote:

New at this. I am having trouble writing my formula (invalid syntex) to
get sum of one field if another field is ="credit"

=Sum([Total_Paid])IIf([MoneyRec]="Credit",0)))

And then I Need to another formula to subtract $700 from the sum for a
net total.
How would I do that?

Can someone help me?

=Sum(IIf([MoneyRec] = "Credit",[Total_Paid],0))

Besides the incorrect syntax you used, it is always good practice to
count your open parenthesis and subtract the close parenthesis in an
expression. If the result is not 0 you'll have a problem. Your
expression had 2 open and 4 close parenthesis. Not good. :-(

For the second question, try:
=Sum(IIf([MoneyRec] = "Credit",[Total_Paid],0)) - 700
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.



Relevant Pages

  • Re: writing formula for Access
    ... Example for your first statement: ... And then I Need to another formula to subtract $700 from the sum for a ... count your open parenthesis and subtract the close parenthesis in an ...
    (microsoft.public.access.gettingstarted)
  • Re: writing formula for Access
    ... And then I Need to another formula to subtract $700 from the sum for a ... count your open parenthesis and subtract the close parenthesis in an ... For the second question, try: ...
    (microsoft.public.access.gettingstarted)
  • Re: Sum not recoginzing a negative number
    ... Now subtract 3 hours. ... Multiplying by -1 ... >>>I have a report in which I am attempting to calculate elapsed time. ... In my report I group the two events by day and sum them ...
    (microsoft.public.access.reports)
  • Re: Comparing sets of data, where criteria met, sum certain column
    ... I would like the results in column I (the lookup) and J (sum of the values). ... yes, "subtract the value in Column D, in the row of the Column A item, ... "Otto Moehrbach" wrote: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Counting # of days between 2 dates excluding Fri & Sat)
    ... I mean, yeah sure, I know what INT, MOD, SUM and WEEKDAY do. ... You subtract this from that then add this then subtract that and divide by ... this but what kind of an explanation is that? ...
    (microsoft.public.excel.worksheet.functions)