Hi Bill,

How about just changing your example a little? Instead of sales, use 1:

 Select fielda, fieldb,
  sum(case when "MONTH" = 1 then 1 else 0 end)
  sum(case when "MONTH" = 2 then 1 else 0 end)
  .
  .
  .
 From Filez
 Group by fielda, fieldb

hth,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax

From: "Bill Erhardt" <ERHARDT@BaldwinHQ.com>
> Thank you for your response but I know how to use the count(*) function.
> What I'm trying to do is use the count function in a case statement like
I'm
> using the sum function below:
>
> Select fielda, fieldb,
>  sum(case when "MONTH" = 1 then sales else 0 end)
>  sum(case when "MONTH" = 2 then sales else 0 end)
>  .
>  .
>  .
> From Filez
> Group by fielda, fieldb
>
>
> > -----Original Message-----
> > From: bill.reger@convergys.com [SMTP:bill.reger@convergys.com]
> > Sent: Tuesday, September 04, 2001 11:29 AM
> > To: midrange-l@midrange.com
> > Subject: Re: Syntax of case statement using a count function
> >
> >
> > SELECT COUNT(*) FROM library/file  WHERE FLDNAM       =   500
> --
>
>
> _______________________________________________
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
> To post a message email: MIDRANGE-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
> or email: MIDRANGE-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.