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

Creating an Array that is reset per change of group

Status
Not open for further replies.

MRYoung

Technical User
May 21, 2015
6
US
Ladies, Gents

I have been working on this problem for awhile now and cannot seem to crack it (I am a self-taught novice at this). I am trying to find the earliest start date that is classified as a labor step(L) within each group

I have set up my code to build the array in the details, evaluate to find the minimum value in the footer and reset in the header. Can any of you here point out my idiocies?
Here is my code:

//////header\\\\\\\WHILEPRINTINGRECORDS;
SHARED DATEVAR ARRAY STARTDATE;
REDIM STARTDATE[1];


/////details\\\\\\WHILEPRINTINGRECORDS;
SHARED DATEVAR ARRAY STARTDATE;


SELECT {JOB_OPERATIONS_WC.LMO}
CASE "L":
(
STARTDATE[UBOUND(STARTDATE)]:=(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
REDIM PRESERVE STARTDATE[UBOUND(STARTDATE)+1];
)

DEFAULT:
(
STARTDATE[UBOUND(STARTDATE)]:=date("12/01/2016");
REDIM PRESERVE STARTDATE[UBOUND(STARTDATE)+1];
)


/////////footer\\\\\\\\\SHARED DATEVAR ARRAY STARTDATE;
Minimum(STARTDATE)
 
Can you post some sample data you are working on?
 
I think I was able to break through and finally fix the code this morning. Thank you for your willingness to help!

below is the code just for reference.
//////header\\\\\\\WHILEPRINTINGRECORDS;
SHARED NUMBERVAR I:=1;


/////details\\\\\\WHILEPRINTINGRECORDS;
GLOBAL DATEVAR ARRAY STARTDATE;
SHARED NUMBERVAR I;

IF {JOB_OPERATIONS_WC.LMO}= "L" THEN
(
REDIM PRESERVE STARTDATE;
STARTDATE:=(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
I:=I+1;
(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
)
ELSE
(
REDIM PRESERVE STARTDATE;
STARTDATE:=DATE("12/01/2016");
DATE("12/01/2016");
)

/////////footer\\\\\\\\\WHILEPRINTINGRECORDS;
GLOBAL DATEVAR ARRAY STARTDATE;
(
MINIMUM(STARTDATE);
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top