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

Multiply One Query Result By another Query Result

Status
Not open for further replies.

simeybt

Programmer
Nov 3, 2003
147
GB
I want to multiply the result of one query by the result of another query and place the value on my report. But I only get an error result when I run the report.

Is there a specfic way i should do this

Simon
 
ok, I’ll try get in as mush as I can. I have a report that pulls information from a number of related queries. The queries sum the amount of a specific sales a specific person sells. this part works fine. What I what to do is a add calculation to the report that pulls the commission rate for a specific sale type and multiply the number of sales by this commission rate. I have the query set up that pulls the correct commission rate for a specific sale type. but how do multiply the result of the sales query with the commission rate query.
 
Typically you would do this in the query. It depends on how you have designed everything and the business rules, but assuming you have a current output of:
(person, salestype,totalsalesamount) then add a step that joins from salestype to the commission table where you can pick up the commission % (say) which then can be used in a calculated field COMMAMT: [totalsalesamount * commrate / 100]. This is calculated for each record and can then be displayed how you like on your form/report.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top