-
Oct 30th, 2000, 12:01 PM
#1
Thread Starter
Addicted Member
Hi
I know this maybe simple for some, but I don't work much with access 97. I need a formula to sum up some fields. Something like this Total = Repairtime + setuptime + pmtime. Can anyone help?
Thanks aja
-
Oct 30th, 2000, 12:24 PM
#2
Frenzied Member
i dont know how to sum all the fields up togather at once
dont know if it could be done either
how i would do it is
make 3 sql statments
and do them as follow
dim Total as double
SQL = "SELECT SUM(repairtime)as Total FROM myTable"
then you need to capture that and return that sum first
RS.Open SQL, conn
Total = RS("total")
RS.close
then do it again
SQL = "SELECT SUM(setuptime)as Total FROM myTable"
then you need to capture that and return that sum first
RS.Open SQL, conn
Total = Total + RS("total")
RS.close
and finally do it for pmtime
SQL = "SELECT SUM(pmtime)as Total FROM myTable"
then you need to capture that and return that sum first
RS.Open SQL, conn
Total = Total + RS("total")
msgbox "Total for all " & Total
RS.close
OR
you this MIGHT work
SQL ="SELECT SUM(repairtime, pmtime, setuptime)
i doubt it will thou
but give it a shot
[Edited by kovan on 10-30-2000 at 12:27 PM]
-
Oct 30th, 2000, 12:27 PM
#3
Thread Starter
Addicted Member
Thanks kovan,
I figured out how to total up the fields in my database. Thanks again for the suggestion!
aja
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|