-
1. Re: Month till yesterday
Deepak RaiMay 8, 2018 12:12 PM (in response to David Núñez)
1 of 1 people found this helpfulIf Year(Order Date)=Year(Today())
AND
MONTH (Order date)=Month(Today)
AND
Day(Order date)<=Day(Today())-1
THEN
Sales
END
This should also work
-
2. Re: Month till yesterday
Jim DehnerMay 8, 2018 1:48 PM (in response to David Núñez)
1 of 1 people found this helpfulHi David - I'm a fan of using datetrunc() -t returns an actual date - so to get MTD through yesterday is
if datetrunc('month',[Order Date]) = datetrunc('month',today()-1) and datetrunc('day',[Order Date])<=datetrunc('day',today()-1) then [Sales] end
Datetrunc('month', today()) returns the first day of the month May 1,2018 likewise datetrunc('day',today()-1) returns May 7,2018
I just like working working with actual dates whe setting ranges
Jim
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.