If you're using oracle, you could so something like this:

SELECT    SUM(DECODE(abstype, 'E', 1, 'U', 1, 0)) AS totalabsences

In plain english, this says:
If abstype = 'E' then add 1 to totalabsences,
elseif abstype = 'U' then add 1 to totalabsences,
else add zero to totalabsences

You can add additional lines to it like this one:
SUM(DECODE(abstype, 'T', 1, 0)) AS totaltardies,
SUM(DECODE(abstype, 'E', 1, 0)) AS totalexcused,
SUM(DECODE(abstype, 'U', 1, 0)) AS totalunexcused
FROM        yourtable
WHERE    yourconditions

If you're using ACCESS, you do this with iif. I can look up the syntax if
you need it. If you're using mssql, I can't help ya.

-d

Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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