• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Dsum help

Experts,

I have the following Dsum in a subform:

=DSum("[USDEquiv]","tblFXRates","[ProjID]=" & Nz([ProjID],0))

Wouldnt this Sum all USDEquiv for ProjID = ProjID?

USDEquiv is a calculated field (see pic).  the Dsum is not summing and only thing I can think of is USDEquiv is a calcualted field and not a field in tblFXRates.   The ProjID's are populated.

here is the calcualted field as shown in the pic:
USDEquiv: IIf([CurrencyID]=1,[tblFXRates].[Amount],([tblFXRates].[Amount]*[ExchangeRate]))

thank you.

tblFXrates,query
0
pdvsa
Asked:
pdvsa
  • 2
  • 2
2 Solutions
 
PatHartmanCommented:
The picture is a little blurry but the field you are referencing is not in tblFXRates.  Change the DSum() to reference the query you show in the picture.  For most purposes, tables and select queries are interchangeable.
0
 
JimFiveCommented:
You need to DSUM on the query that contains the calculation not the table.
0
 
pdvsaProject financeAuthor Commented:
OK.  I guess I need to make a saved query because the query only resides on the record source of form?
0
 
PatHartmanCommented:
Yes.  Create a querydef and then reference it from both places.
0
 
pdvsaProject financeAuthor Commented:
thank you....will be asking a similar question in just a minute.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now