I am assuming SQL Server but try this query.
Code:Select Item, Sum(Case When Year(DateField) = 2004 Then 1 Else 0), Sum(Case When Year(DateField) = 2003 Then 1 Else 0) From Table1 Group By Item
|
Results 1 to 5 of 5
Thread: Counting Records with CaseHybrid View
|
Click Here to Expand Forum to Full Width |