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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculations

Status
Not open for further replies.

spinalwiz

Programmer
Joined
Feb 25, 2003
Messages
32
Location
IT
I have a table with the following fields:

Equipment Quantity Cost

And on a form I want to display the total cost (i.e. the sum of all costs * quantities).

How do I go about this?

Thanks
 
The question is a bit unclear but to get this total then just add an unbound textbox to a forma set the control source as
=dsum("[cost] * Quantity", "[mytablename]")

Obviously using your own table name.
 
Thanks. Thats it exactly. Why was it unclear? Maybe I should have but brackets in:

The Sum of all (Cost * Quantity)


Another question:

Instead of a table name can I put in a SQL query.
 
Sorry - an SQL query that joins 2 or more tables
 
'Why was it unclear'

Well if that's what you wanted then it wasn't unclear. It sounded too straightforward a question (I don't mean trivial) and I was waiting for the 'yes..but..."


Must get rid of the paranoia ...but there's all these people out to confuse me, y'know!
 
Crowley16,

You say I can put it in a query, but can I put a query into it? (the dsum function)

 
can I put a query into it? (the dsum function)
Yes, provided this is a named query

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top