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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset Date Variable

Status
Not open for further replies.

blueboyz

Technical User
Sep 13, 2005
210
0
0
US
Peachtree Premium 2009, Crystal Reports v2008, Pervasive SQL 10.0

I am trying to display the last date an item was received.
I created four variables:

{@Last Received}//placed in suppressed Details section
If {JrnlHdr.JrnlKey_Journal} = 4 then {JrnlRow.RowDate}

{@Max Last Rec'd}//placed in suppressed Details section
WhilePrintingRecords;
DateVar ReceivedDate := Maximum({@Last Rec'd});

{@Display Max Last Rec'd}//placed in Group Footer#1 section
WhilePrintingRecords;
DateVar ReceivedDate;

{@Reset Max Last Rec'd}//placed in Group Header #1
WhilePrintingRecords;
DateVar ReceivedDate := Date(0,0,0);

The report is displaying the same date for all inventory items 3/15/08. Some items should have a February date and some a different date in March.

How can I reset the value in the {@Max Last Rec'd} variable?
 
Assuming you are grouping on Item_Num, place the item_num field in detail section. In group footer place a formula:
Maximum({table.last_recvc},{table.item_num)
 
Also note that you could do this with just your original formula:

If {JrnlHdr.JrnlKey_Journal} = 4 then
{JrnlRow.RowDate}

Place this in the detail section, right click on it and insert a maximum at the group level. No need for variables at all.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top