5 pts.
 Crystal Reports last twelve months
I wrote a report that accululates invoice totals for each customer in a sql database based on period and year for period. I manually entered the last 11 months in the formulas by taking current month minus 1, then current month plus 10, year minus one and so forth. How can I make this process automatic.

Software/Hardware used:
ASKED: February 7, 2009  10:00 PM
UPDATED: March 13, 2009  4:36 PM

Answer Wiki:
A simple way in Crystal, I am assuming that the report date is restricted to a single full year, then: Make a formula extracting the month from the date field - MONTH(Subtotal) Then make a formula for each month - if {@Month} = 1 then {Subtotal} else 0 - do this for each month. Alternative if you have an open date on the report, no overall date restriction and your SQL is a DateTime field use: if {DocDate] in DateTime (200, 01, 01, 00, 00, 00) to DateTime (2009, 01, 31, 00, 00, 00) then {Subtotal}. If is is a date field use: if {DocDate] in Date (200, 01, 01) to Date (2009, 01, 31) then {Subtotal}. Please these calculated fields in the Details section. Then create a Group for the Customers and you can sum the invoices to the Group (Customer) and hide the details. This method requires all of the data to be pulled into Crystal. If you can create a view on the SQL server to sum the records by Customer or Sales region it is much quicker to only pull the sums in to the Crystal report. These are simple solutions, but will require an annual update on the formulas, option one on the overall date restriction, option two on each of the monthly formulas. Hope this helps.
Last Wiki Answer Submitted:  March 13, 2009  4:36 pm  by  Pinkert11   15 pts.
All Answer Wiki Contributors:  Pinkert11   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _