Forum Discussion

Clayton_cramer's avatar
Clayton_cramer
Copper Contributor
Jan 26, 2021
Solved

Inserting empty rows

This should be simple, but my SQL skills are rusty.  I have a query that extracts the year and a count of incidents from  a table. SELECT year, Count(year) AS incidents FROM Table2 WHERE ((Table2....
  • Gustav_Brock's avatar
    Gustav_Brock
    Feb 04, 2021

    Clayton_cramer If you don't like IIF, then use IN:

    SELECT 
        year, 
        Abs(Sum([cause_ID] In (15, 16))) AS incidents
    FROM 
        Table2
    GROUP BY 
        year;

Resources