If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to total calculated fields
I am calculating my "Line" total like this:
=IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]) in a field called "txtTotal" To get a total of line items I have tried these: =Sum([txtTotal]) =Sum([ChargeDays]*[PerDiemRate]) =Sum(([ChargeDays]*[PerDiemRate])) =sum((IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]))) all if these give me "#error" regardless if the list is filtered or not filtered Any help here will be appreciated. Thanks in advance |
#2
|
|||
|
|||
How to total calculated fields
It is hard to sum text.
Try this --- =sum((IIf([ChargeDays]=Null,0,[ChargeDays]*[PerDiemRate]))) OR =sum((IIf([ChargeDays]=0,0,[ChargeDays]*[PerDiemRate]))) based on whether you have nulls or blanks. -- KARL DEWEY Build a little - Test a little "Dave" wrote: I am calculating my "Line" total like this: =IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]) in a field called "txtTotal" To get a total of line items I have tried these: =Sum([txtTotal]) =Sum([ChargeDays]*[PerDiemRate]) =Sum(([ChargeDays]*[PerDiemRate])) =sum((IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]))) all if these give me "#error" regardless if the list is filtered or not filtered Any help here will be appreciated. Thanks in advance |
#3
|
|||
|
|||
How to total calculated fields
Slight correction. If ChargeDays can be Null, you'd want
=Sum(IIf(IsNull([ChargeDays]),0,[ChargeDays]*[PerDiemRate])) or =Sum(Nz([ChargeDays], 0)*[PerDiemRate]) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "KARL DEWEY" wrote in message ... It is hard to sum text. Try this --- =sum((IIf([ChargeDays]=Null,0,[ChargeDays]*[PerDiemRate]))) OR =sum((IIf([ChargeDays]=0,0,[ChargeDays]*[PerDiemRate]))) based on whether you have nulls or blanks. -- KARL DEWEY Build a little - Test a little "Dave" wrote: I am calculating my "Line" total like this: =IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]) in a field called "txtTotal" To get a total of line items I have tried these: =Sum([txtTotal]) =Sum([ChargeDays]*[PerDiemRate]) =Sum(([ChargeDays]*[PerDiemRate])) =sum((IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]))) all if these give me "#error" regardless if the list is filtered or not filtered Any help here will be appreciated. Thanks in advance |
#4
|
|||
|
|||
How to total calculated fields
None of either of your suggestions worked.
Am I doing something else wrong? dave "Dave" dave@accessdatapros wrote in message ... I am calculating my "Line" total like this: =IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]) in a field called "txtTotal" To get a total of line items I have tried these: =Sum([txtTotal]) =Sum([ChargeDays]*[PerDiemRate]) =Sum(([ChargeDays]*[PerDiemRate])) =sum((IIf([ChargeDays]="","",[ChargeDays]*[PerDiemRate]))) all if these give me "#error" regardless if the list is filtered or not filtered Any help here will be appreciated. Thanks in advance |
#5
|
|||
|
|||
How to total calculated fields
On Fri, 28 Dec 2007 14:15:25 -0800, "Dave" dave@accessdatapros wrote:
None of either of your suggestions worked. Am I doing something else wrong? Presumably. What are you doing? I can't see it from here. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|