Math functions in ado

Results 1 to 3 of 3

Thread: Math functions in ado

  1. #1
    Jeff Turner Guest

    Default Math functions in ado

    Hi, I&#039;m needing help with a script that I&#039;m writing that pulls results out of a database according to a date range. I can pull the records out no problem, but Im not real sure how to perform math functions on the results to get a total amount from the grouped results. A number value in the "total" field (money total on a purchase) is what I want to add. Here is my SQL statement, after which I use a simple &#060;%do until objrec.eof=true%&#062; Loop.<BR><BR>SQL="SELECT * FROM fass_receipt WHERE date_entered &#062;&#039;" & startdate & "&#039; AND date_entered&#060;&#039;" & enddate & "&#039; ORDER BY date_entered asc"<BR><BR>I&#039;d appreciate any help someone could give me. You can respond to this post or email me at<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Math functions in ado

    No problem. Use something like:<BR><BR>Set objRS=Server.CreateObject("ADODB.Recordset")<BR>ob jRS.Open SQL, yourConnection<BR><BR>While not objRS.EOF<BR> RunningTotal=RunningTotal+objRS("Total")<BR> objRS.MoveNext<BR>Wend<BR>response.Write "My total is " & RunningTotal

  3. #3
    Jeff Turner Guest

    Default RE: Math functions in ado

    Thanks! That worked!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts