ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 11th, 2003, 09:26 AM
sanj sanj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 133 sanj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 18 m 21 sec
Reputation Power: 11
String Count

Hi,

Is there something wrong with this statement?

SELECT COUNT(applod.CAT) AS CATSR FROM applod WHERE applod.CAT LIKE '%SR%'

This colum has various values such as 1, 2, SR all I want is the number of records that have the value SR in them.

Also are you able to make calulations to recordsets, for example

producta = 20
productb = 30
productc =40

((Sum (producta) + sum (productb) + sum (productc)) / (Sum (productc)))

to give me a percentage?


Regards,

Sanjay

Reply With Quote
  #2  
Old March 21st, 2003, 12:40 AM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
Try the following
Code:
<%
Dim Checkvalue
CheckValue="SR"
strquery="SELECT COUNT(applod.CAT) AS CATSR FROM applod WHERE applod.CAT=" & Checkvalue
%>


As for the maths on your results, you should be able to write ASP code via loops etc to add up your values, divide them, multiply them etc.

__________________
How can I soar like an eagle when
I'm flying with turkey's?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > String Count

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap