Addition with record results

Ok, I have an ASP app I'm building. I have a page that returns results from an Access database based on some variables from a form. One of the fields it returns is "hours worked", and I want to add the hours from all the returned records, but I don't know where to start.

For example: Search for records between a certain date range, completed by a certain staff member. It returns 5 records and the hours worked are: 1.5, 2.5, 8.0, 5.0 and 3.5 for each record returned respectively. I'd like to add all of those up to show total hours worked as 20.5 hrs. Thanks for the help.
Ellis_JuanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib KhanSenior DeveloperCommented:

in You Asp Loop Through them and Add them to sum up

 While not Rs.eof

  TotalHours = Rs("Hours") + TotalHours

 Rs.movenext
 wend

Response.write TotalHours
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ellis_JuanAuthor Commented:
Thanks, that almost worked perfect. I just needed to change it slightly because it wasn't adding the values, it was just placing them next to each other.

I did this:

While not reports.eof

  TotalHours = abs(reports("work")) + abs(TotalHours)

 reports.movenext
 wend
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.