Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2005, 08:34 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default asp add

How do i add all the values of a variable called 'segments' together.

typical values are:

4
4
2
20

any ideas?

------------------------------------------

segments = cdbl(count_trip_id)*cdbl(number_of_passengers)

-----------------------------------------

whenn it is outputted into a HTML table it is written out as:

<td align="center">
    <%=segments%>
    </td>

this is inside a while loop also.

plz help


__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old January 31st, 2005, 08:35 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

My Code:

<%
    while not rs.eof

    A1_pnr = rs("A1_pnr")
    'response.write "A1_pnr = " & A1_pnr & "<br>"

    set rs4=con.execute("select count(trip_id) from trip_details where trip_id like '%"& A1_pnr &"%'")
    'response.write "" & ("select count(trip_id) from trip_details where trip_id like '%"& A1_pnr &"%'") & "<br>"

    set rs5=con.execute("select no_of_pass from trip_cost where trip_id like '%"& A1_pnr &"%'")
    'response.write "" & ("select no_of_pass from trip_cost where trip_id like '%"& A1_pnr &"%'") & "<br>"

    trip_id = rs4("trip_id")
    'response.write "Trip ID = " & trip_id & "<br>"

    count_trip_id = rs4("count(trip_id)")
    'response.write "Count TRIP ID = " & count_trip_id & "<br>"

    number_of_passengers = rs5("no_of_pass")
    'response.write "Number of Passengers = " & number_of_passengers & "<br>"

    segments = cdbl(count_trip_id)*cdbl(number_of_passengers)
    'response.write "Segments = " & segments & "<br>"

%>
<tr bordercolor="#ececec" bgcolor="#ececec">
 <td align="center">
 <%=rs("A1_pnr")%>
    </td>
 <td align="center">
    <%=rs("leadname")%>
    </td>
<%
smouse=rs("Destination_Arrival_Time")
smouse2=rs("Destination_Arrival_Date")
set rscount=con.execute("select count(trip_details.trip_id) from trip_details INNER JOIN trip_master on (trip_details.trip_id = trip_master.trip_id) where trip_master.regular_trip = 'Confirmed'")
total_segments = rscount("count(trip_details.trip_id)")
'response.write "Total Segments = " & total_segments & "<br>"

'total_segments = ("select count(trip_details.trip_id) from trip_details INNER JOIN trip_master on (trip_details.trip_id = trip_master.trip_id) where trip_master.regular_trip <> 'Cancelled'")
'response.write "Total Segments = " & total_segments & "<br>"
'response.write "" & ("select count(trip_details.trip_id) from trip_details INNER JOIN trip_master on (trip_details.trip_id = trip_master.trip_id) where trip_master.regular_trip <> 'Cancelled'") & "<br>"
%>
<td align="center">
    <%=rs3("dep_airport")%>
    </td>
<td align="center">
    &nbsp;at&nbsp;<%=smouse%>" onmouseover="style.cursor='hand'"><%=rs("Destinati on_Airport")%>
    </td>
<td align="center">
    <%=segments%>
    </td>
<td align="center">
    <%=rs5("no_of_pass")%>
    </td>
<% if rs("regular_trip") = "Cancelled" then %>
<td align="center">
    <b><%=rs("regular_trip")%></b>
    </td>
<% else %>
<td align="center">
    <%=rs("regular_trip")%>
    </td>
<% end if ' if rs("regular_trip") = "Cancelled" %>
</tr>
<%
    rs.movenext
    'response.write "Segments = " & segments & "<br>"
    'segments_total = cint(segments)
    'segments_total = ("select count(trip_id) from trip_master where regular_trip = 'Confirmed'")
    'response.write "Segments = " & segments_total & "<br>"
    wend
    'response.write "A1 PNR = " & A1_pnr & "<br>"
%>


 
Old March 4th, 2005, 10:34 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

http://www.aspin.com/home/tutorial/database/addrecor

www.crmpicco.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I add asp to html metalman923 HTML Code Clinic 1 October 5th, 2006 10:38 AM
HELP ME to add a record to a database using ASP kumail Classic ASP Databases 3 August 18th, 2005 05:33 AM
Add asp.net page to asp project debdemoe Classic ASP Basics 0 August 17th, 2005 12:28 PM
ASP to add to Database gilgalbiblewheel Classic ASP Databases 7 September 3rd, 2004 06:43 PM
how to add checkboxes in this asp gilgalbiblewheel Classic ASP Databases 1 August 10th, 2004 12:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.