Hi
I have two tables
1. "Employee"
"No.";"Fund. wage"
And
2. "Emp. Fund. wage"
"Date";"Emp No.";"Amount"
I want field "Fund. wage" in first table shows "Amount" from second table where Date is highest. and "emp no=no."
I think it is impossible but I better ask first
Thanks.
0
Comments
1) Extend "Employee" to include a "Fund. Wage Date" field, flowfield CalcFormula=MAX("Emp. Fund. wage".Date WHERE "Emp. No." = FIELD("No."))...
2) Now, Employee."Fund. wage" could be a flowfield CalcFormula=LOOKUP("Emp. Fund. wage".Amount WHERE "Emp. No." = FIELD("No.") AND "Date" = FIELD("Fund. Wage Date"))...
But, now the correctness of (2) depends on (1) being calculated first... Hmm...
I will answer this on the basis that when you say that the Date is the "highest", you mean the latest?
I believe all you need to do is on the "Emp. Fund. Wage" table is set the primary key to be "Emp No.",Date. Then you make the "Fund. Wage" in the "Employee" table a flowfield, and the
CalcFormula=MAX("Emp. Fund. wage."Amount WHERE "Emp. No." = FIELD("No."))
By using MAX, it is finding the last Emp. Fund. wage entry based on the primary key (Which is Emp No and Date), but since the Employee number is restricted to the one Employee we are looking at, it should find the last Dated entry for that Employee.
In the case you wanted to find the earliest Dated entry for that Emp. Fund. wage, all you would need to do is change the MAX in the CalcFormula to MIN.
Hope this helps.
Thanks for reply
Fb.. i think about it yesterday. Flowfield can't calculate formula based on the other flowfield
Knight
I have solution exactly like yours. It didn't work. This formula calculate Record where AMOUNT is highest . I think MAX depends on field (amount) , not on primary key.
Sorry for my english :?