I think you just need to add something to your WHERE
clause.

For example, if you just want to count U+E, use

WHERE ((T_ABS.ABSDATE >= T_Quarter.BegQuarter) AND
      (T_ABS.ABSDATE <= T_Quarter.EndQuarter)) 
AND   (
        (T_ABS.ABSType = 'U') 
        OR
        (T_ABS.ABSType = 'E') 
      )

--- Janine Jakim <[EMAIL PROTECTED]> wrote:
> ABSType is the column being counted. In it there are
> several different codes
> that are used depending on what is appropriate for
> the student.  They
> include:
> T=Tardy
> U=Unexcused Absence
> E=Excused Absence
> So my query does fine in the sense that it counts
> how many T/E/U each
> student has.  The next step is to add E+U= Total
> Absences
> I assume it needs to happen outside the query?
> 
> -----Original Message-----
> From: cf refactoring
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 4:31 PM
> To: CF-Talk
> Subject: Re: adding counts
> 
> 
> Can you show your table structure? 
> I need to know how do you distinguish absent from
> tardy from excused from unexcused? Where in the
> table
> is it located and how is the information
> represented?
> 
> --- Janine Jakim <[EMAIL PROTECTED]> wrote:
> > I've got a query that counts how many times a
> > student is absent/tardy.  It
> > outputs fine  BUT i need it to do things slightly
> > differently- I need to
> > combine a couple of the codes to make a total (For
> > example 3 Excused +2
> > Unexcused= 5 absences).  What is the best way to
> do
> > this?
> > 
> > <CFQUERY NAME="MissedDays" DATASOURCE="dsn">
> > SELECT T_ABS.QUARTER, T_ABS.ID,
> Count(T_ABS.ABSType)
> > AS CountOfABSType,
> > T_ABS.DAYTITLE
> > FROM T_ABS, T_Quarter 
> > WHERE ((T_ABS.ABSDATE >= T_Quarter.BegQuarter) AND
> > (T_ABS.ABSDATE <=
> > T_Quarter.EndQuarter)) 
> > GROUP BY T_Quarter.QUARTER, T_ABS.ID,
> T_ABS.DAYTITLE
> > </CFQUERY> 
> > 
> > So how do I get my CountOfABSType to do this?
> > Thanks in advance.
> > j
> > 
> >


=====
I-Lin Kuo
Macromedia CF5 Advanced Developer
Sun Certified Java 2 Programmer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to