chrisl1471
Registered User.
- Local time
- Today, 15:35
- Joined
- Dec 12, 2017
- Messages
- 11
Hello all, I am in need of some help building what I believe is a complex query for a DB I am building.
I have a list of "TV/SHIP" being built in a plant, these "items" go through various "AreaGroups" on various dates "complete". All of this data exists in a single table within the DB.
What I am attempting to do is build a query that does the following.
User inputs their "areagroup", the query runs filtering the LAST 5 "tv/ship" that have a date "Complete" < Date() and = to the user input areagroup.
I would then use that query data, to filter some other various data records to show a report/chart showing how long project x took on "items" 5; 4; 3 and so on for comparison sorted by the oldest one to the most recent "item" to have completed the "Station". In theory this would show if the "areagroups" are they improving? Sustaining? etc.
I do not believe I can simply use LAST in my query because each item goes through each station, so the last TV/Ship may or may not be through the last station at the time the query is ran. I have added an attachment that shows what I mean (I hope).
In the attachment the 1st column "TV/SHIP" shows 2 different ships, as you can see both go through various areagroups and complete on a date....
So if I entered 475-1A, I would want the query to go find the last 5 "Ships" where the complete date < Date() and = areagroup entered.
I have a list of "TV/SHIP" being built in a plant, these "items" go through various "AreaGroups" on various dates "complete". All of this data exists in a single table within the DB.
What I am attempting to do is build a query that does the following.
User inputs their "areagroup", the query runs filtering the LAST 5 "tv/ship" that have a date "Complete" < Date() and = to the user input areagroup.
I would then use that query data, to filter some other various data records to show a report/chart showing how long project x took on "items" 5; 4; 3 and so on for comparison sorted by the oldest one to the most recent "item" to have completed the "Station". In theory this would show if the "areagroups" are they improving? Sustaining? etc.
I do not believe I can simply use LAST in my query because each item goes through each station, so the last TV/Ship may or may not be through the last station at the time the query is ran. I have added an attachment that shows what I mean (I hope).
In the attachment the 1st column "TV/SHIP" shows 2 different ships, as you can see both go through various areagroups and complete on a date....
So if I entered 475-1A, I would want the query to go find the last 5 "Ships" where the complete date < Date() and = areagroup entered.