I need help on a case when statement. I am pulling a query of invoices based on the invoice date from and invoice date to range. If the invoice date is any quarter end date (i.e. 3/31/2014, 6/30/2014, 9/30/2014, 12/31/2014, 3/31/2015, 6/30/2015, etc...) then set value as ‘Mgmt Fee’ else all other non-quarter end invoice dates (i.e. 4/1/2014, 4/29/2014, etc…) to ‘Final Fee’ end as TYPE.
Below is a sample of my SQL statement. Any help on this without using a function or stored procedure against the database would be awesome. Is it possible to do this as a select or creating a #temp table on each run?
select INVOICEDATE, ACCOUNT, FEE
, case when INVOICDATE in [QtrEndDate] then ‘Mgmt Fee’ else ‘Final Fee’ end as TYPE
where INVOICEDATE >= @FromDate
and INVOICDATE DATE <= @ToDate