Crystal Reports v2008
Quantum 2009/Pervasive SQL v10
I need to write a report to show inventory quantities available currently as well as 6 months forward and 6 months past. For example, if my current date is Oct. 7 the report would show:
Apr 7
May7
Jun 7
Jul 7
Aug 7
Sept 7
Oct 7
Nov 7
Dec 7
Jan 7
Feb 7
Mar 7
Apr 7
(The dates would actually be the columns and not the rows.)
There is a formula for the quantity on hand {@Quantity}.
How do I write a formula to display the quantities for inventory that is 6 months before and 6 months after the current date?
WhilePrintingRecords;
DateVar Column1 := DateAdd("m", -6,{@ReportDate});
DateVar Column2 := DateAdd("m", -5,{@ReportDate});
DateVar Column3 := DateAdd("m", -4,{@ReportDate});
DateVar Column4 := DateAdd("m", -3,{@ReportDate});
DateVar Column5 := DateAdd("m", -2,{@ReportDate});
DateVar Column6 := DateAdd("m", -1,{@ReportDate});
DateVar Column8 := DateAdd("m", +1,{@ReportDate});
DateVar Column9 := DateAdd("m", +2,{@ReportDate});
DateVar Column10 := DateAdd("m", +3,{@ReportDate});
DateVar Column11 := DateAdd("m", +4,{@ReportDate});
DateVar Column12 := DateAdd("m", +5,{@ReportDate});
DateVar Column13 := DateAdd("m", +6,{@ReportDate});
//Column8 is the current month and day
{@ReportDate} = Today
The formula for the columns gives me an error that "A date is required here" and highlights
DateAdd("m", -6,{@ReportDate})
Quantum 2009/Pervasive SQL v10
I need to write a report to show inventory quantities available currently as well as 6 months forward and 6 months past. For example, if my current date is Oct. 7 the report would show:
Apr 7
May7
Jun 7
Jul 7
Aug 7
Sept 7
Oct 7
Nov 7
Dec 7
Jan 7
Feb 7
Mar 7
Apr 7
(The dates would actually be the columns and not the rows.)
There is a formula for the quantity on hand {@Quantity}.
How do I write a formula to display the quantities for inventory that is 6 months before and 6 months after the current date?
WhilePrintingRecords;
DateVar Column1 := DateAdd("m", -6,{@ReportDate});
DateVar Column2 := DateAdd("m", -5,{@ReportDate});
DateVar Column3 := DateAdd("m", -4,{@ReportDate});
DateVar Column4 := DateAdd("m", -3,{@ReportDate});
DateVar Column5 := DateAdd("m", -2,{@ReportDate});
DateVar Column6 := DateAdd("m", -1,{@ReportDate});
DateVar Column8 := DateAdd("m", +1,{@ReportDate});
DateVar Column9 := DateAdd("m", +2,{@ReportDate});
DateVar Column10 := DateAdd("m", +3,{@ReportDate});
DateVar Column11 := DateAdd("m", +4,{@ReportDate});
DateVar Column12 := DateAdd("m", +5,{@ReportDate});
DateVar Column13 := DateAdd("m", +6,{@ReportDate});
//Column8 is the current month and day
{@ReportDate} = Today
The formula for the columns gives me an error that "A date is required here" and highlights
DateAdd("m", -6,{@ReportDate})