If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > So I am trying to perform a calculation on an asp page but

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-11-10, 12:20
ben2203 ben2203 is offline
Registered User
 
Join Date: Feb 2010
Posts: 21
So I am trying to perform a calculation on an asp page but

I am kind of new to asp so not sure where to start.

So I have these:

<td align="right"><p>ยอดคงค้าง:</p></td>
<td align="left">
<p><%=intPreviousTotal%></p>
</td>

So intPrevious Total comes from this sql:

rsPreviousTotal.Open "SELECT Total.[sumofextended price] AS Total FROM tbl_ShipOrders INNER JOIN qrycondetailsextendedtotals AS Total ON Total.ship_ID = tbl_shipOrders.ship_order_ID WHERE chkloaded = yes AND Paid = 1 AND payment_id = 4 AND Deposited = No AND Branch_ID = " & branchID, oCOnn, 1, 3

after this:

do while not rsPreviousTotal.EOF
intPreviousTotal= intPreviousTotal + rsPreviousTotal(0)
rsPreviousTotal.MoveNext
loop

and the variables being declared and the initial value being set to zero just incase there is something stored in the cookies etc.

So it works fine but now I want to perform a calculation from these totals to draw the balance from it. Basically deducting all the deductables from the total.

Actually, I am looking for some advice on how I could go about doing it
Reply With Quote
  #2 (permalink)  
Old 03-11-10, 13:27
ben2203 ben2203 is offline
Registered User
 
Join Date: Feb 2010
Posts: 21
Actually I have managed it with:

<tr>
<td align="right"><p>Left:</p></td>
<td align="left">
<p><&#37;=(intprevioustotal)-(inttotal_discountpr)-(intexpenses)%></P>
</td>
</tr>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On