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!

Multiplying two fields

Status
Not open for further replies.

Brettgons

Technical User
Apr 14, 2007
11
US
I have a table with several fields. one is quantity and another is cost and a final is sub total. I want to multiply the nembers in the quantity field and cost field and have it display in another field called sub total on the same table.

How do i do this?????
and where do i do this?

ex. quant cost subtotal
2 5.00 10.00

I am new at this and need help

 
Normally as per the rule of "RDBMS" it calculated data won't be wriiten to the table. You can do it in a query at any time.
[tt]
SubTotal:[ex.quant]*[cost][/tt]

will give you the result in the query.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
After the query, i want to create a report. i will have multiple entries. How can i get the subtotal to show for each entry?
I want to show a Total at the bottom that sums all the sub total fields
 
How are ya Brettgons . . .
Brettgons said:
[blue]How can i get the subtotal to show for each entry?[/blue]
[blue]ZmrAbdulla[/blue] has already shown you with:
Code:
[blue]SubTotal:[ex.quant]*[cost][/blue]
The above is a custom field that you add to your query. Just enter the code on the first empty field on the field row in query design view. Run the query to see the results. Then just use the query as the [blue]RecordSource[/blue] for the report.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
That worked. If i understand everything, if i want to show a total for the sub total, i do the same proceedure?

or what would be the command for summing the sub total for a new field called total?

i can add a text box in the report footer to show the total amount.
 
ControlSource of the textbox is to be
Either
=Sum([SubTotal])
or:
=Sum([ex.quant]*[cost])
Try both

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
That worked out great. Thanks to all who helped me.

One more question if i may. how can i add a custom button to a table that will export the highlighted selection and export out to an excel spread sheet. The spread sheet could be an existing one with data in it.
 

Have a search on "export access query to excel" in these forums and the web

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top