|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > String Count |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|