Crystal 2008 - Convert fiscal year to calendar year

Our fiscal year starts in June and ends in May.  The GL_Data table in our ERP database has a year field and has monthly credit and debit fields.

The field names are: gl_year,debits@1, credits@1, debits@2, credits@2 and so on.  

I want to be able to run this report from January 2013 to December 2013.
This would be for periods 8-12 for FY2012 and periods 1-7 in FY2013.

I need a way to set up an automatic report with date ranges set via parameters.
We know we need to group by year, but that groups by fiscal and does not show us true Calendar year data.  

This is an example of what I have
gl_year debits@1 credits@1 debits@2 credits@2 debits@11 credits@11 debits@12 credits@12
2012                                                                                        7                   4                 20          3
2013                    10          5            22           15                        

and the results I need
April 2013 - 3
May 2013 - 17
June 2013 - 5
July 2013 - 7

Thank you for you help,
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SO the field names are credits@nn and debits@nn where nn is the fiscal year month with June being 1 and May being 12?

BobLeeSwaggerAuthor Commented:
Yes that's correct.
Can you build a view in the database?
Can you use a Command as the data source?

Here is a method that will work.  Unfortunately you have to build formulas for each month

Basic formula for Jan - May  Vary the CRn from CR9 to CR12
If {Sheet1_.FY} = {?CY} - 1 then
    CDbl ({@myNull})

Basic formula for Jun - Dec  Vary the CRn from CR1 to CR7
If {Sheet1_.FY} = {?CY} then
    CDbl ({@myNull})

You need a parameter for the year.

The formula myNull is just an empty formula with that name


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

I don't understand your example.  The results that you posted don't seem to match the example data on the two lines above that.  Are your example data and results just unrelated sets of numbers, or is there some correlation that I'm not seeing?

 Ignoring that for the moment ...

 You said that you needed to "group by year".  A potential problem with that idea is that a single record contains data from two different calendar years, and a record can only be in one group.  But if the report will never include more than one calendar year, then I guess that's not a problem.


 What's the point of using CDbl ({@myNull}) ?  Why not just use 0?  Just curious.

 I just did a quick test and I see that it would leave the field blank on the report, but I don't see why you'd want that, instead of just letting the result be 0.

I wasn't sure what he was doing with the values.  Since 0 could be meaningful in the results, the NULL is a better indicator that there is no data for that month

Fair enough.  Like I said, I was just curious.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.