SQLTeam.com | Weblogs | Forums

Date Condition with Case query

I need sales as if yesterdays date i.e 16 August so this is my Query which gave me zero result for sales -
Here Net_Amount Is column for sales figure,

sum(case when Date=FORMAT(GetDate()-1, 'yyyy-MM-dd') then Net_Amount else 0 end) as TodaysSales From SalesM

Now We have Friday Holiday , I want that if Friday comes then it should count from 15 August i.e Thursday. I have one table calendar Table there is one column Isweekend ='1' for Friday , How I can use this in my query as already I put one case
SalesM table has Month column and calendar table also has month and year column.

Without more information, check out the date_part function. For better responses post create table and inserts to set up sample data for us to work with and include the desired result using the provide sample data.