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!

Help Finding Data from a different line

Status
Not open for further replies.

MRYoung

Technical User
May 21, 2015
6
US
Howdy,

New user here, and I have a slight problem.

I have a Work Order Records Table, with both parent and child work orders alike. The only parameter that determines if a Work Order is a child is an entry of a Work Order number in a Parent column.

I want to write a code that would take the number from that Parent column, then search the document and find the parent work order row and return the corresponding due date.

A any help would be hugely appreciated.

Thanks,

 
Just link the parent table to the child table by the work order number.
 
The Parent and the Child Work Orders are on the same table. The only difference between the two are that children have the parent work order called out in a column (not the unique identifier column)
 
Bring in a second copy of the table (you can change the name) and link them together.
 
I linked the tables together, but I am still not quite sure how to select the record I want. Here is what I have:
IF {JOB_HEADER.PARENT_WO}={JOB_HEADER_1.JOB} AND {JOB_HEADER.PARENT_SUFFIX_PARENT}={JOB_HEADER_1.SUFFIX} THEN
{JOB_HEADER_1.DATE_DUE}
ELSE
"ERROR"

This unsurprisingly is still returning the due date of the child and not the parent, but I do not know what to do.
 
Excel_Sample_Data_ygxvmo.jpg


Here is a quick sample I made in Excel to illustrate the data in the tables. Please note that the tables do NOT have the "Parent Due Date" column, that is what I am trying to create with my report. I hope this clears up my dilemma.

Thanks a lot!
 
Add a second copy of your table to the report, link it by Parent Work Order in the first table to Work Order in the second table. {table_1.due_date} is the Due Date of the parent work order.

You can rename the table in the Database expert. I'd rename {table_1} as "Parent" just to make it clearer when you look at it later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top