Urgent!! Calculating totals (1 Viewer)

uniboy

Registered User.
Local time
Today, 05:06
Joined
Feb 11, 2011
Messages
16
Hi, I have a database assignment for uni, in which i have created a database system for a personal training company. I have been trying to calculate the weekly takings in a report form but have not been able to.

For example, in a certain week they may have been 6 sessions conducted, all a different price, now i want to add all of those up and show it in a new text box i created in the report design view called TOTAL.

i dont know if i need coding for this or if theres a simple way to do this? i would really appreciate some feedback guys,

thanks.
 

Beetle

Duly Registered Boozer
Local time
Yesterday, 22:06
Joined
Apr 30, 2011
Messages
1,808
No, you should not need any code for this. You would normally create a query that would show each session and the associated price. Then you would create a report based on this query and in the report footer you would place a calculated control that would Sum all the prices to show a total.

Have you done any of the above?

If not, what have you tried so far?

What is the structure of the table that holds the data?
 

uniboy

Registered User.
Local time
Today, 05:06
Joined
Feb 11, 2011
Messages
16
Well in the report, the fields to be shown are:

SessionID, Session date, WorkoutiD, Workout_type, Workout_cost





Total (added in report)


I tried things like sum=workout_cost, but i have little experience and am very confused. what do i need to do?
 

Beetle

Duly Registered Boozer
Local time
Yesterday, 22:06
Joined
Apr 30, 2011
Messages
1,808
Put a text box in the Report Footer. Open the properties sheet for the text box, click on the Data tab and in the Control Source put;

=Sum([Workout_cost])
 

uniboy

Registered User.
Local time
Today, 05:06
Joined
Feb 11, 2011
Messages
16
Just tried that Sean but in the text box appeared #Error

Any ideas?
 

Beetle

Duly Registered Boozer
Local time
Yesterday, 22:06
Joined
Apr 30, 2011
Messages
1,808
What is the record source of this report?

If it's a table please post the basic structure and field names.

If it's a query please post the SQL
 

uniboy

Registered User.
Local time
Today, 05:06
Joined
Feb 11, 2011
Messages
16
oh dude I just moved the text box from "Page footer" to "Detail" and it worked! but, the total was then showed after each session and i just want it to show once. Do you know how to create a new heading thing like "Detail" to put it under??
 

Beetle

Duly Registered Boozer
Local time
Yesterday, 22:06
Joined
Apr 30, 2011
Messages
1,808
As per my previous post, it needs to go in the Report Footer. If you don't currently have a Report Header/Footer then you can add one from the View menu.
 

uniboy

Registered User.
Local time
Today, 05:06
Joined
Feb 11, 2011
Messages
16
Ah yes, i was putting it in the page footer, thats why it wasnt working. It now works.

Thank you soooo much sean!! I really appreciate it mate!!!!
 

Users who are viewing this thread

Top Bottom