Business Objects Crystal Reports comes with some really nice standard functions that make working with your data very easy. I have been working on series of blog posts that introduces some of these functions to help SalesLogix report writers with their efforts. Today I will focus on the start writing about function under the category of "Date Ranges" The first set we will look at are the aging, more specifically Aged0to30Days, Aged31to60Days, and Aged61to90Days.
The function looks at the current date and depending on the function being used will return records that fall within the date range.
The syntax for the formula is very basic:
{Table.DateField} in Aged0to30Day
So in SalesLogix, if I wanted to create a quick report that list all of Accounts created within the last 30 days I could write this Record Selection formula:
{ACCOUNT.CREATEDATE} in Aged0To30Days
To expand the functionality for my users, I could add a parameter with some choices like "0 - 30 Days" which will allow my users to select which of the three functions they want to use, my Record Selection Formula will then look like this.
if {?DateRange} = "0 - 30 Days" then {ACCOUNT.CREATEDATE} in Aged0To30Days
else
if {?DateRange} = "31 - 60 Days" then {ACCOUNT.CREATEDATE} in Aged31To60Days
else
if {?DateRange} = "61 - 90 Days" then {ACCOUNT.CREATEDATE} in Aged61To90Days
We could even go a little bit farther and add to our parameter some values like "Last 60 Days" and "Last 90 Days". Then again edit our Record Selection formula and add:
else
if {?DateRange} = "Last 60 Days" then {ACCOUNT.CREATEDATE} in Aged0To30Days or {ACCOUNT.CREATEDATE} in Aged31To60Days
else
if {?DateRange} = "Last 90 Days" then {ACCOUNT.CREATEDATE} in Aged0To30Days or {ACCOUNT.CREATEDATE} in Aged31To60Days or {ACCOUNT.CREATEDATE} in Aged61To90Days
Nothing real fancy here. I am sure there are other ways to get this same thing accomplished but I hope this gives some of the new users out there an idea of how to use these functions.
Happy New Year!
Please have a plan and Stay Safe