06-17-12, 15:31 #1Registered User
- Join Date
- May 2012
Unanswered: Perform a sort for multiple tables
I have a table called 'Tasks' and another called 'Queues'. Each task is added to the Task table and has a reference to a row in Queues. There is also a field called TimeModified for each task, which represents the time a task is created or modified. What I want is some way of selecting the queue with the earliest TimeModified value. But the Queues table will not have this field, but it should somehow find it from the Tasks within the queue.
QueueId | Active 1 | Yes 2 | Yes
Task Id | TaskModified | QueueId | TaskComplete 100 | 10/06/2012 10:00 | 1 | No 101 | 10/06/2012 10:01 | 1 | No 102 | 10/06/2012 10:02 | 2 | No
Task Id | TaskModified | QueueId | TaskComplete 100 | 10/06/2012 10:03 | 1 | Yes 101 | 10/06/2012 10:01 | 1 | No 102 | 10/06/2012 10:02 | 2 | No
To give you an idea of what could be done, when the above state is reached a query could look like this:
QueueId | Active | QueueModified 1 | Yes | 10/06/2012 10:03 2 | Yes | 10/06/2012 10:02
Any ideas on how I could achieve this?
Last edited by Elph; 06-17-12 at 15:37.
06-18-12, 03:29 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
don't understand the description, sorry.. therefore cant helpI'd rather be riding on the Tiger 800 or the Norton