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

sum a custom field

Status
Not open for further replies.

heathlovell

IS-IT--Management
Oct 26, 2002
36
US
Hello,
I have report that lists employee vacation hours and their pay rate. I created a field ("Text19) on each line that takes the two fields and multiplies them together. This works fine. I am trying to sum this field over the whole report. I have tried =sum([Text19]) but when I run the report it pops up an input box asking for Text19. Thanks for any help,
Heath
 
mp9,

hopefully not

e.g.

? 9 * 5
45
? 6 * 11
66
? 15 + 16
31
? (9 * 5) + (6 * 11)
111
MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
heathlovell

A way is to include the detail calculation in the report recordsource (query?). Then, just do the sum on the new (calculated) field (you can also use it to display the value in the detail section for each individual).

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Michael

Logically so, surely. Brackets within the Sum() should be processed first, so ([PayRate]*[VacationHours]) should get calculated first and the result of this calculation should then be considered by the Sum().

However, logic seems to have gone out the window as this returns #Error instead... [pc2]
 
Sorry - if you put the formula from my first post in the the report header or report footer it works correctly (e.g. it correctly returns 111 in Michael's example). It's only if you put the text box with the formula in the page footer, as I stupidly did whilst testing, that you get the error.

HTH [pc2]
 
Thanks for the tips. I will try your suggestion. I have been pretty busy. As soon as I find out, I will let you know.

Thanks,
Heath
 
Hello,
I have tried to re-create the expressions in the query, but one (vacation time used) used a Dsum to look up how much vacation time the employee has used. I can't get the criteria section to work. I need the employeeID for each record in the query to match employeeID in the attendance table, but I don't know how to do this. Thanks for the help,
Heath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top