Last Day of Previous Year or First Day of Current Year Calculation in Crystal Reports
You have a requirement to use the last day of the previous year or the first day of the current year and you don’t want to be hard coding any values into the report.
Very simply.
For Last Day of Previous Year: Create a Formula @PrioYearEnd
date(Year(currentdate)-1,12,31)
For First Day of Current Year simply remove the -1 from current date;
date(Year(currentdate),01,01)
Remove trailing character in Crystal Reports Formula
This is a relatively straight forward formula to help you remove the last character of a string.
It may be that you wish to remove a period from the end of a field name or an inverted comma. Here we will call our field {DBField1}
left({DBField1},len({DBField1})-1)
All we are doing here is using the left function to display all the characters to the left, excluding the last chacter, (which is determineted by the “Len” function)
NOT IN Syntax – Excluding records in Crystal
So you need to exclude a few records from your reports in Crystal.
Perhaps that stray erroneous record in the DB which has never been fixed, or a list or exclude customers for a certain country/state.
If you have a list of values and you want to exclude them, then NOT IN will help you do to this. This can be used for both record selection, or on the suppression criteria for groupings.
So lets say you want to exclude customer ID’s 1512, 1563 and 1765 from appearing in your report.
Simply add in your selection criteria;
NOT({CustomerID} IN [“1512″,”1563″,”1765”])