I need some help building a SQL Server function that acts as a SumIf in Excel, for example
SumIf
SumIF(Fees.Fee_Amount, Fees.Type =\'Services\' and F
The simplest way would be to SUM a CASE clause, like so:
SUM(CASE WHEN Fees.Type ='Services' and Fees.Fee_Code = 'B01' THEN Fees.Fee_Amount END) AS ColumnAlias,