![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm working on FM7 in XP. I have three databases: Orders, LineItems and LineItemsDaily. Each record in Orders contains an OrderID. Each record in LineItems contains an OrderID, PartID, DateOut and DateIn. There may be many LineItem records for each Order record. Each record in LineItemsDaily contains OrderID, PartID, and Date. For each LineItems record there are several records in LineItemsDaily, one for each Date between DateOut and DateIn inclusive. I want to script a Find that will find the earliest Date for each LineItemDaily combination of PartID and OrderID for a collection of LineItems. So far, I've created a calc field in LineItems that returns "OrderID PartID DateOut" and a calc field in LineItemsDaily that returns "OrderID PartID Date". So I can find the LineItems I want, say 17 records, each with a unique calc field. How do I then use that to find the 17 records in LineItemsDaily with the same result in its calc field? I've created a relationship that connects LineItems to LineItemsDaily based on "OrderID PartID Date" but don't know where to go from there. Thanks, |
#3
| |||
| |||
|
|
In article <1126378107.124656.244580 (AT) g47g2000cwa (DOT) googlegroups.com>, grip (AT) cybermesa (DOT) com says... I'm working on FM7 in XP. I have three databases: Orders, LineItems and LineItemsDaily. Each record in Orders contains an OrderID. Each record in LineItems contains an OrderID, PartID, DateOut and DateIn. There may be many LineItem records for each Order record. Each record in LineItemsDaily contains OrderID, PartID, and Date. For each LineItems record there are several records in LineItemsDaily, one for each Date between DateOut and DateIn inclusive. I want to script a Find that will find the earliest Date for each LineItemDaily combination of PartID and OrderID for a collection of LineItems. So far, I've created a calc field in LineItems that returns "OrderID PartID DateOut" and a calc field in LineItemsDaily that returns "OrderID PartID Date". So I can find the LineItems I want, say 17 records, each with a unique calc field. How do I then use that to find the 17 records in LineItemsDaily with the same result in its calc field? I've created a relationship that connects LineItems to LineItemsDaily based on "OrderID PartID Date" but don't know where to go from there. Generally its difficult to go from a found set in on database to a foundset in a second table that is the aggregage of found sets from a relationship in the first record. It can be done, but its not exactly clean, and I'd suggest 2 alternative approaches instead |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
|
I've never found related records from a multi-line global, not sure how that works. |
#7
| |||
| |||
|
|
Just a note for any who may not already be aware: FM8 provides this feature natively, with no fancy work. 42 wrote: In article <1126378107.124656.244580 (AT) g47g2000cwa (DOT) googlegroups.com>, grip (AT) cybermesa (DOT) com says... I'm working on FM7 in XP. I have three databases: Orders, LineItems and LineItemsDaily. Each record in Orders contains an OrderID. Each record in LineItems contains an OrderID, PartID, DateOut and DateIn. There may be many LineItem records for each Order record. Each record in LineItemsDaily contains OrderID, PartID, and Date. For each LineItems record there are several records in LineItemsDaily, one for each Date between DateOut and DateIn inclusive. I want to script a Find that will find the earliest Date for each LineItemDaily combination of PartID and OrderID for a collection of LineItems. So far, I've created a calc field in LineItems that returns "OrderID PartID DateOut" and a calc field in LineItemsDaily that returns "OrderID PartID Date". So I can find the LineItems I want, say 17 records, each with a unique calc field. How do I then use that to find the 17 records in LineItemsDaily with the same result in its calc field? I've created a relationship that connects LineItems to LineItemsDaily based on "OrderID PartID Date" but don't know where to go from there. Generally its difficult to go from a found set in on database to a foundset in a second table that is the aggregage of found sets from a relationship in the first record. It can be done, but its not exactly clean, and I'd suggest 2 alternative approaches instead |
#8
| |||
| |||
|
|
Thank you all. 42: I am currently wrestling with whether DateOut will change or not. My client thinks it may...rarely. And so at what point do you complicate design to accommodate exceptions? |

|
Anyway, size isn't an issue, as DailyLineItems are deleted as the DateIn passes. |
![]() |
| Thread Tools | |
| Display Modes | |
| |