1. To not return zero values where there are non-zero values that sum to zero add a HAVING clause:
select #1=10 (avg(btu_inj)) (min(btu_inj))=10 (max(btu_inj))=10 (avg(btu_with))=10 (min(btu_with))=10 (max(btu_with))=10 from + minmax5 group by #1 + HAVING (avg(btu_inf)) <> 0 + OR (min(btu_inf)) <> 0 + OR (max(btu_inj)) <> 0 + OR (min(btu_with)) <> 0 + OR (max(btu_with)) <> 0 [EMAIL PROTECTED] wrote: > >Is there a way to get the MIN, MAX, and AVG while ignoring zero values? Ie, >getting the minimum non-zero value.. > >I have a view setup and a select that groups my data by month and year with >the min max and avg of some btu values; however I am not interested in the >zeroes! > >I know this ignoring of zero can be done in Excel but it is easier to do the >grouping in Rbase.. > >Here's my view: >-------------------- >CREATE VIEW minmax5 + >(yr_month,btu_inj,btu_with) AS �+ >select ( (ctxt( (iyr(gasday)))) + '/' + (ctxt( (im+ >on(gasday)))) ) btu_with btu_inj from daily_data g+ >roup by #1 btu_inj btu_with > > >Here's my current select: >------------------------- >select #1=10 (avg(btu_inj)) (min(btu_inj))=10 (max(btu_inj))=10 >(avg(btu_with))=10 (min(btu_with))=10 (max(btu_with))=10 from + >minmax5 group by #1 > >Thanks! >Charley > > >Charles Sikora >Coordinator, Gas Storage >Manlove Field >Peoples Energy Corporation >(217)-897-7123 > > -- Albert Berry Full Time Consultant to PSD Solutions 350 West Hubbard, Suite 210 Chicago, IL 60610 312-828-9253 Ext. 32 __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

