cancel
Showing results for 
Search instead for 
Did you mean: 

How do you insert a "prior period" in Crystal Reports 2008

Former Member
0 Kudos

I am constructing a income statement that compares this current period versus the same period from last year. I used the parameter field and filter list for one time period. Is it possible to have a comparison time period on the same report.

For example Revenue and Expense amounts for the 2nd Qtr of 2010 and on the same report on the next column 2nd Qtr Revenue and Expenses for the 2nd Qtr of 2009?

Thanks for any help

jim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Not sure how your parameters are working but assuming you have a date range and you enter

01/01/2010, 31/03/2010

Your select statement will look like


(DateField = {?daterangeParam} or 
datefield in dateadd("yyyy", -1, minimum({?daterangeParam}) ) to dateadd("yyyy", -1, maximum({?daterangeParam}) ) )

Wrap in brackets to include other filters, this should get parsed to SQL with out any impact on performance

Ian

Answers (1)

Answers (1)

0 Kudos

Hi Jim,

If that sum exists in the database just drop it in. If not them it's likely quicker to create a stored Procedure to do all of the summing and ata collection server side and then use that data source in a subreport and filter/lin it on the same month code as the main report.

Other option, but will likely be a performance hit is to drop the main report into the main report as a subreport and again link on the month code. Then you can get the valuses. Strip out as much as you can from the subreport so it runs faster.

Any way you do this you need to use a subreport.

Thank you

Don

Former Member
0 Kudos

So I need to create a 2 additional sub reports if I want these 3 columns side by side on my income statement report.

1) Current period - date range with $ amounts

2) Prior period - date range with $ amounts

3) Year To Date - date range with $ amounts

Does anyone know of a link or example on how to do this.....I figure it is a very common practice....at least in the accounting and finance community?

thanks Jim

Former Member
0 Kudos

Hi Jim,

On the Crystal Reports (program) home page, there is a link to sample reports. There is a sample income statement that compares 2 periods where the user inputs the 2 periods. It's either under features samples or financial samples.

Heather