Like many have asked (but not for Crystal Reports that I can find), I'm looking for how to get the previous quarter start and end dates.
Since today is 7/10/2014, I can use
DateAdd("Q", -1, CurrentDate)
and it returns 4/10/2104 12:00:00AM
What I want is the previous quarter start and end dates. For today, that would be 4/1/2014 and 6/30/2014. In October, it should instead return 7/1/2014 and 9/30/2014. I only want the date part, not the time.
I'm looking through the Crystal Date and Time and Date Ranges options, and just not seeing what I need to do.
First date of previous quarter:
Last date of pervious quarter:
To get the first date in the quarter, the following will work:
And the last date is similar:
It turns out the above will NOT work if the previous quarter is also in a previous year. The following is better. There's enough code to put in your own date and display the results, so it can be checked, too.