![]() |
Sergey Kornilov admin 3/23/2005 |
Hi, if IsNumeric(rs("CourseB")) then tCourseB = tCourseB + rs("CourseB")
|
N
|
nitescan 6/23/2008 |
I'm having the same problem but don't know where to find this code. Where can I find Looprs Function? What file needs to be edited? |
J
|
Jane 6/24/2008 |
Hi, |
![]() |
lefty 9/1/2008 |
how do you average with a null value? Column A (TEXTFIELD) Column B (NUMBER) CourseA 100 CourseB AVERAGE 50 How can you modify the code.....? Thanks!
|
J
|
JOHNF777 9/2/2008 |
Here's what I usually do to some of my query: |
![]() |
lefty 9/3/2008 |
Here's what I usually do to some of my query: I modify the SQL manually with: Select field1, IsNull(field2,0) as field2 From table1 This zeroes the Null values. Hope this helps.
|
J
|
JOHNF777 9/3/2008 |
Thanks for your help ; I tried this method also but the calculation above won't work ; when one of the fields does have a value greater than 0 the calculation above results in 0 on the list page. either field can be null in the record but two of them will always have a value greater than 0. ex. ((fielda / fieldb) 100) + ((fieldc / fieldd) 100) As total ex. ( (3 / 6 ) 100) + ((0 / 0) 100 ) ex. 50 + 0 = 50
|
![]() |
lefty 9/4/2008 |
John, Have tried this in the query? CASE When isnull(field1/field2 100) then 0 ELSE (field1/field2 100) END AS field3 I try to do some of the qualifying/query by creating custom views in MSSQL. Hope this helps.
|
M
|
mbr 9/7/2008 |
Hi, I just joined to the forum as a member.. I have been using ASP runner for roughly 9 months now and use this forum frequently to look for solutions... I had a similar problem which was solved as follows: |
![]() |
lefty 9/8/2008 |
Hi, I just joined to the forum as a member.. I have been using ASP runner for roughly 9 months now and use this forum frequently to look for solutions... I had a similar problem which was solved as follows: I inserted the following code into the HTML code of my list page which already had the built in fucntion of ASPRunner to add column totals. I wanted to get the average for "total score" on test inspections being administered to my employees; however, some of these test results had to appear in my rows as a blank value (too long to explain why)... bottom line i wanted ONLY the rows that contained a score to be taken into account when averaging the score (in other words, skip the blank rows so they won't affect the average calculation). Here is the code ------custom code inserted into page that was generated by ASPRunner--- [color=#FF0000]dim isTotalScoreNull isTotalScoreNull = true if isNumeric(rs("TOTAL SCORE")) then isTotalScoreNull = false end if '-------code below was already created by ASPrunner when itgenerated the list page---- rs.MoveNext do while not rs.eof retval=true DoEvent "retval=BeforeProcessRowList(rs)" if retval=false then rs.MoveNext else exit do end if loop '------the next 3 lines were already placed there by ASPRunner when the page was generated-------- if isTotalScoreNull = false then recno=recno+1 end if '-------------- [color=#FF0000]This I can't seem to fiqure out where this code above is placed or is generated from. can you give me the page this goes on ? wend rowinfo.add ri,row ri=ri+1 The following code looks right ;[color=#FF0000] if I insert it in the list page I get error on 'wend' expected statement wend smarty.Add "rowinfo",rowinfo rs.Close end if ' show totals dim total total = GetTotals("AutoID",totals("AutoID"),"COUNT",recno-1,"") smarty.Add "showtotal_AutoID", total total = GetTotals("TOTAL SCORE",totals("TOTAL SCORE"),"AVERAGE",recno-1,"")[/color] '----- ---
|