Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return period data based on Report Date in Crystal Reports v 10

Status
Not open for further replies.

Talon911

Instructor
Oct 5, 2007
1
US
I'm looking to create a report that will return quantity sold for the previous 12 months, by month, for inventory items. Report date is a parameter. The table containing the sales data has the following fields: Item #, Warehouse, Year, Qty Sold Period (one field for each period in the fiscal year).

I need to create a formula that will take the report date and return the correct quantity sold for the current period and each period prior to the report date for the prior 12 periods. Can anyone point me in the right direction?

Thanks!
 
Design report to group and summarise by month as you require.

In selection expert

{yourdatefield} >= dateadd("m", -12, date(year(currentdate), month(currentdate),1))

Based on todays date formula will return 1 March 2010, if you want 1 April 2010, change to -11.

Ian
 
What you need to do is group by month, or maybe do a crosstab. The use of Crystal's automated totals is outlined at FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top