Jump to content

Calculate in ASP


zuper89
 Share

Recommended Posts

How can i calculate information that is in a database with asp?example:I got 4 user in a databasehow can i get the avarage age og the members?example 2I 3 colons in a database table,wich is all number, how can i get the totalsum of the numbersSorry my english, Im Norwegian

Link to comment
Share on other sites

I did like this, and that worked nice :);

<%DIM sumsum = (objPO("po_votes1") + objPO("po_votes2") + objPO("po_votes3") + objPO("po_votes4") + objPO("po_votes5") + objPO("po_votes6") + objPO("po_votes7") + objPO("po_votes8") )%>

But i got another problem, if the answer is;51,6260162601626 how do i do to let it be 51,63 ??

Link to comment
Share on other sites

DIM sumsum = (objPO("po_votes1") + objPO("po_votes2") + objPO("po_votes3") + objPO("po_votes4") + objPO("po_votes5") + objPO("po_votes6") + objPO("po_votes7") + objPO("po_votes8"))sum = Round(sum, 2)

or

Dim sumsum = Round(objPO("po_votes1") + objPO("po_votes2") + objPO("po_votes3") + objPO("po_votes4") + objPO("po_votes5") + objPO("po_votes6") + objPO("po_votes7") + objPO("po_votes8"), 2)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...