Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals won't add up

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
The fields in a Totals query come from another query. I want to add the total that is being calculated in one field to a given total in a new field.

The query for this new field might look like this

PlusHits: Sum([qryTrimmed].[ShortUrl]+[qryTrimmed].[Hits])

The Total line in QBE is set to Expression.

PlusHits is the new name for the field.
qryTrimmed is the query feeding this query.
ShortUrl is the field I want to add to the total in the Hits field of this new query.

Of course, it won't work like that. And I can't think how to name this new field - as it doesn't exist in the query that feeds this query.

Sounds complicated. Sorry. Yet there must be a way to have Access tot up the two fields. Musn't there?
 
kupe,
First let me make sure I understand your situation.

You have a query, qryTrimmed, which has fields named ShortUrl and Hits. Even if Hits was a calculated field in this query, you can continue additional calculations in further right fields in the same query. (I am not quite sure where Hits got calculated.)

Assuming I am understanding, you don't even need to put this into an aggregate function (Totals where you would write Expression on the Totals line.) All you need to do is create a new field

PlusHits:[ShortUrl] + [Hits]

This will do. As long as both fields are NOW in the qryTrimmed (the names of fields in this query), you do not need to reference them to the query's name.

If this does not work, just e-mail me a screen print of the query in design view.

skennedy10@sbcglobal.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top