Re: using a count function

2010-05-29 Thread mos
Chris, You are using Count when you should be using Sum. Here is a solution you can try: SELECT SUM(IF(DATEDIFF(dateofinterview,dateofbirth)/365.25 BETWEEN 0 AND 18.999, 1,0)) AS "18 and Under", SUM(IF(DATEDIFF(dateofinterview,dateofbirth)/365.25 BETWEEN 19 AND 65.999, 1

using a count function

2010-05-29 Thread Chris Elhardt
This is probably pretty obvious to everyone except me. I have a couple of columns, DateOfInterview and DateOfBirth in a table named Demographics For a monthly report I have a script where the operator enters the start and end dates of the reporting period. I need a query result with sing