View Full Version : Adding To get a total


stu_c
05-08-2009, 03:41 AM
hi all
i have got records for people who have hire cars in this i need to add the Actual hire cost, Fuel cost and other costs together to get a OVERALL cost,

We recently did this in excel but we are now moving all the records into access. how or where do i input this formula into the table on access to automatically add the amounts togther?

marjdk
05-08-2009, 03:50 AM
You have to this in a query. The table is just the storage of your data and if doesn't allow you to do calculations in the table itself.

stu_c
05-08-2009, 03:51 AM
what would the calculation be?

DCrake
05-08-2009, 03:52 AM
This can all be done in a query as this is a calculation, this is not condoned saving calculations in fields, if you condiser all the elements that make up the calculation if you change any sigle entity you would have to change the total field to reflect the change.

So in your query you would have something along the lines of

TotalCost: (Fuel+Charges+Tax+etc)


David

stu_c
05-08-2009, 04:00 AM
so do i copy this straight into a SQL

stu_c
05-08-2009, 04:09 AM
I have attached the Database so Far,
All that needs to be done is the
Actual cost+Fuel+Other Cost = TOTAL COST

many thanks

DCrake
05-08-2009, 04:19 AM
Just had a very quick look at it and one thing jumped out at me:eek: You need to rename the *Other costs field. Access does not like naming conventions like that. Also try and remove spaces in your names. Use CamelCase to name your fields it is much easier to read and code.

As I said before in your query you create a new column and add together the fields that make up the total cost.

David

stu_c
05-08-2009, 06:03 AM
anyone help my im soo confused !!

speakers_86
05-08-2009, 11:16 AM
Don't expect people to hold your hand for every simply query you want to do.

Notice the changes I made to your table. I changed it to CamelCase, and corrected the formats.