Link to home
Start Free TrialLog in
Avatar of Erin Leale
Erin LealeFlag for United States of America

asked on

Crystal Report - 12 Month Sales Data

Good evening,

I have a sales report that I need to show gallons by month - I need it to roll for 12 months including the beginning date.  For example - the user would enter 1/1/2017 and it would report Jan - Dec for 2017.  I manually plug the formulas but I know there is a way to automate it.  I'm drawing a blank - can you help?  

I have attached a screen shot of the report.  

thanks.
Avatar of Mike McCracken
Mike McCracken

I don't see the screen shot.

Is your problem in selecting the data based on the selected date?
This selection formula will pull 12 months of data based on the entered date

{YourDateField} BETWEEN {?StartDate} AND DAteAdd("m", 12, {?StartDate})

Will they always enter the 1st of the month or can they select any date?
If they select any date do you want the data for 12 months from that date or from the first of the month?

mlmcc
Avatar of Erin Leale

ASKER

Hi mlmcc,

By the date selected - the data should always return a full month for the range.  So the user could select 1/1/2017 as the start date and the data should return each month with the gallons.  They could also do 5/1/2016 as the start and I would need each month from May 2016 - April 2017 data.  The attachment is a Jpeg of the report.  I can attach the report if needed too.  This is using a SQL database.
Sales-12-month-rolling.jpg
Do you need to drill into the details?

I assume you only need to see the 12 month summary

mlmcc
Summary only.  Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This works perfectly - Thank you!!!!!