20. august 2001 - 14:37Der er
8 kommentarer og 1 løsning
Add up the values from a recordset
Hey There
I am attempting to add up the contents from my db the colume name is called PrisIalt <-- setup as danish kr in the db How would I go about adding these totals up and getting them displyed ?? My script looks like this <% DO UNTIL wine_order_info.EOF %> <tr><td><%=wine_order_info(\"PrisIalt\")%></td></tr> <% wine_order_info.MoveNext LOOP %> Its PrisIalt that I would like to be added up and then displayed at the bottom of my asp page If anyone knows how you would go about this it would be great Thanks Guzzie
Hey there guys :) both your answers did the same thing if for example I have three prices then they I dont get a total I just get a print out for example like this 175,00212,50325,00 as you can see this is just the prices next to each other and not added ? any ideas guzzies
Never mind thanks anyway guys but I got it done buy myself heres how i done it <% Connect.Open strDSN tracking = session(\"tracking_you\") Set wine_order_info = Connect.Execute(\"SELECT * FROM tracking WHERE tracking = \'\" & tracking & \"\'\") resultat = 0 %> <% DO UNTIL wine_order_info.EOF %> <% resultat = resultat + wine_order_info(\"PrisIalt\") %> <% wine_order_info.MoveNext LOOP %> <tr><td>Result:<%=resultat%></td></tr>
Guzzie
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.