sum specific records

aussiehedge

Registered User.
Local time
Tomorrow, 00:44
Joined
Nov 24, 2006
Messages
10
I need to sum specific records that contain DAHF and DIDF they are from the same table Column that has different codes eg FRT and DIDF. To get the local sell amt. The table name is [Charge Code]

I have tried the following

=Sum(IIf([Charge Code] = "DITF" Local Sell Amt],0)) This returns DITF value o.k. so i would though by adding the other code i would get the value of both.

=Sum(IIf([Charge Code] Like "DITF" And "DAHF",[Local Sell Amt],0)) This returns the total value of all records. No sure why.

When i get this worked out i will need to add about 12 codes to complete my sum and about 4 codes i do not want included.
 
I presume you want OR rather than AND, since the code can not be both:


=Sum(IIf([Charge Code] = "DITF" OR [Charge Code] = "DAHF",[Local Sell Amt],0))
 

Users who are viewing this thread

Back
Top Bottom