× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The following code is returning averages for 5 different fields in the
record. However I need to change the code to exclude 0 values in each of
the average calcs. How would this be accomplished?

C/exec sql
C+ DECLARE R2CSR CURSOR FOR Select mpMrs,A1,A2,A3,A4,A5
C+ From
C+ (SELECT MPMRS, AVG(MPOVSA) AS A1, AVG(MPI5TMS) As A2,
C+ AVG(MP#ATTS) AS A3, AVG(MP#INSTS) As A4, AVG(MP#SCPS) AS A5
C+ FROM MRSSTATSPF
C+ WHERE MPDATE >= :YYYYMMDD3 AND MPDATE <= :YYYYMMDD
C+ AND MPPGRP = :WKGROUP
C+ Group By mpMrs) As avgList
C+ ORDER BY
C+ (Case When :WKSTARDSC = 'OVERALL AVERAGE' Then A1
C+ When :WKSTARDSC = 'i5 SCREEN TIME' Then A2
C+ When :WKSTARDSC = '# OF ACCOUNTS ATTEMPTED' Then A3
C+ When :WKSTARDSC = '# OF TOTAL INSTRUMENTS' Then A4
C+ When :WKSTARDSC = '# OF SCREENS COMPLETED' Then A5 End) DESC
C/end-exec

Thanks,

Jay Vaughn
Senior I5 Programmer/Analyst
RateWatch
(P) 251.209.8968
www.rate-watch.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.