Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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
  #1 (permalink)  
Old January 28th, 2005, 11:13 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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 count- help needed!

running this command in mysql control centre in winxp gives me back the value - '28':

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'

but in asp,

<%
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>"
%>

gives me:

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'

any ideas?

Picco

__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old January 28th, 2005, 11:21 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

You need to create a recordset using your query & then get the value from the field "count(trip_details.trip_id)"
It might be easier to change the query to select count(trip_details.trip_id) AS total ...etc and then you can use myRecordsetName("total").Value to get the value.

HTH,

Chris

  #3 (permalink)  
Old January 28th, 2005, 11:30 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
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

dont understand chris mate,

as it stands:

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'")




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count lines in ASP arshad mahmood Classic ASP Professional 3 June 7th, 2006 09:56 AM
character count of ms-word in asp.net sh.rajkumar ASP.NET 1.0 and 1.1 Professional 0 May 19th, 2006 07:24 AM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
Count, sum, count a value, return records CongoGrey Access 1 April 18th, 2005 02:25 PM
Help needed for ASP COM leotiger Classic ASP Components 0 December 2nd, 2003 08:53 AM





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