November 28, 2017 at 1:13 pm
Jeff Moden - Monday, November 27, 2017 9:05 PMdrew.allen - Monday, November 27, 2017 10:33 AMcraig.jenkins - Monday, November 27, 2017 9:28 AMGreat thank you Thom A. Which part does if '1st day of the the new quarter then show the last quarter - where is this in the code?' Many thanks appreciate itThis is what I meant about changing the perspective. You described your issue from the perspective of today: If today is the first day of the quarter use the last quarter (that is use yesterday's quarter), otherwise use today's quarter( which will also be the same as yesterday's quarter unless today is the first day of the quarter ). This caused you to need different conditions depending on whether it was the first day of the quarter. By changing your perspective, this can be simplified because you only have one condition: use yesterday's quarter.
So instead of using today as your frame of reference (GETDATE()), use yesterday as your frame of reference (GETDATE() - 1).
craig.jenkins - Monday, November 27, 2017 9:50 AMThank very much, i clearly need to do a lot more reading. Thanks againYou're not going to learn this by reading. This requires a different way of thinking about the problem.
Drew
Heh... which you can't learn unless you first read. 😉
In order to think outside of the box, you must first realize that you are in a box.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply