123FakeSt
IS-IT--Management
- Aug 4, 2003
- 182
My first week in Crystal formulas (sorry for the lack of braces ... i'm a VB guy)
I am trying to get the lines on this invoice to create a month description in this fashion:
The first set of lines displays the description of the next month (a 10/1/05 invoice will display "November 2005")
When the next set of lines begins (the first {ARTran.TaxCat} will repeat) it will move on to "December 2005" until the group is done.
This isn't working
The early bird gets the worm, but the second mouse gets the cheese.
I am trying to get the lines on this invoice to create a month description in this fashion:
The first set of lines displays the description of the next month (a 10/1/05 invoice will display "November 2005")
When the next set of lines begins (the first {ARTran.TaxCat} will repeat) it will move on to "December 2005" until the group is done.
This isn't working
Code:
NumberVar Sequence;
StringVar initProd;
NumberVar MonthCount;
Sequence := Sequence + 1;
If Sequence = 1 Then StringVar initProd = {ARTran.TaxCat};
If Sequence = 1 Then MonthCount = 1;
If Sequence > 1 Then If {ARTran.TaxCat} = initProd Then MonthCount = MonthCount + 1;
MonthName(Month({ARDoc.DocDate})+ MonthCount) & " " & ToText(Year(DateAdd("m",1,{ARDoc.DocDate})),"0000");
The early bird gets the worm, but the second mouse gets the cheese.