These formulas generate the current quarter start and end dates if that is all you need, and you can then use the formulas in other formulas:
Start
If {?Predefined Date Range} = "Current Quarter" Then
DateTime(Year(CurrentDate),3*Truncate((Month(CurrentDate)-1)/3)+1,1,0,0,0)
End
If {?Predefined Date Range} = "Current Quarter" Then
If Month (CurrentDate) > 9 Then
DateTime(Year(CurrentDate),12,31,23,59,59)
Else
DateTime(Year(CurrentDate),3*Truncate((Month(CurrentDate)+2)/3)+1,1,23,59,59)-1
I'm not sure how or were to use your code,
when I put it in as a formula, I get "The remaining text does not appear to be part of the formula"
The cursor stays at the beginning.
Is declare suppost to be in blue? Is this crystal, or basic syntax, is this written in version of CR that is older than 8.5, and therefore could my problem be that CR 8.5 does not recognize the code?
Not in the select expert, place it in a formula and reference the formula from within the select expert.
The other code was a SQL script for use with a SQL database to create a table of quarters in case you wanted all quarters referenced, your post stated you wanted a list of quarters, I posted the second option in case that was of interest.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.