I am using CR 2010. I am building a report off a SQL command that's been loaded into my report. I need to only pull the current and prior year from the following field: Command.Date Stamp. It is formatted as DateTime.
Any help with the formula for is appreciated, thanks!
"Press any key to continue. Where's the 'Any' Key?" ~Homer SimpsonIf I am using an SQL command. I normally put the filter in with the command. It depends on the database vendor (Oracle, MS-SQL, MySQL, etc.) on how to get the current and prior year. Otherwise you could use a selection formula. There a number of ways to do it. But it would be best if you provide us exactly what you mean by current and prior year (Fiscal year, calendar year, year to date, etc.)
The database is SQL Developer for Oracle.
By Current year and prior year I mean this calendar year (2016) and last calendar year (2015) and when the new calendar year hits on January 1, the report will automatically display only 2017 and 2016 records.
I may have found a formula that works in Crystal:
year()>= year(currentdate)-1
I inherited the SQL command, and am not as versed in that language yet, but am much more comfortable in the Crystal environment.