Select SUM(CASE isnull(Year(IO7_DateOfDisplacement), 0) WHEN (IO7_DateOfDisplacement is < 2007) THEN 1 ELSE 0 END) AS [Before 2007], SUM(CASE isnull(Year(IO7_DateOfDisplacement), 0) WHEN (Between 2007 and 2008) THEN 1 ELSE 0 END) AS [Between 2007-2008]
select SUM(xyz) from table_name where YEAR(your date field)=//or whatever is your condition
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)