leonardokroeger
New member
- Local time
- Yesterday, 17:53
- Joined
- Jul 7, 2011
- Messages
- 4
Hello everybody,
I'm new to this forum and - most importantly new to Access (2010).
I'm trying to sort a query in a slightly more sophisticated way, and I'm not having much success.
This is the scenario:
I want clients from tblClients to appear in a query in a certain order.
We call those clients and the call time is recorded in a call table, tblCalls. If there was no call for a client, there is no respective record in the calls table.
Next we want to be able to call first those clients which have their most recent call as the most unrecent call of all other clients.
How do I sort the clients table to have those clients listed first in a suitable query? (And of course the never called clients even before them)?
I want to be able then to build a form upon that query that shows up clients' details record by record in that order. This form must be updateble.
Client 1
Client 2
Client 3
Call 1 Client 1 on 01/01
Call 2 Client 1 on 02/01
Call 3 Client 1 on 03/01
Call 4 Client 2 on 04/01
Call 5 Client 2 on 05/01
Call 6 Client 2 on 06/01
Query should display:
Client 3 (no call)
Client 1 (last call = his maxValue or most recent call on 03/01/)
Client 2 (last call = his maxValue or most recent call on 06/01/ > maxValue or most recent call Client 1)
I'm kind of desperate... any try envolving totals in this or a related query renders it "not updateble" - including forms that I built upon the query.
What am I doing wrong? Any links or explanations? Google doesn't help me anymore...
Thanks a lot!
This is the farest I got. Using the following query to sort a query including all clients' details makes the second one not updateble:
I'm new to this forum and - most importantly new to Access (2010).
I'm trying to sort a query in a slightly more sophisticated way, and I'm not having much success.
This is the scenario:
I want clients from tblClients to appear in a query in a certain order.
We call those clients and the call time is recorded in a call table, tblCalls. If there was no call for a client, there is no respective record in the calls table.
Next we want to be able to call first those clients which have their most recent call as the most unrecent call of all other clients.
How do I sort the clients table to have those clients listed first in a suitable query? (And of course the never called clients even before them)?
I want to be able then to build a form upon that query that shows up clients' details record by record in that order. This form must be updateble.
Client 1
Client 2
Client 3
Call 1 Client 1 on 01/01
Call 2 Client 1 on 02/01
Call 3 Client 1 on 03/01
Call 4 Client 2 on 04/01
Call 5 Client 2 on 05/01
Call 6 Client 2 on 06/01
Query should display:
Client 3 (no call)
Client 1 (last call = his maxValue or most recent call on 03/01/)
Client 2 (last call = his maxValue or most recent call on 06/01/ > maxValue or most recent call Client 1)
I'm kind of desperate... any try envolving totals in this or a related query renders it "not updateble" - including forms that I built upon the query.
What am I doing wrong? Any links or explanations? Google doesn't help me anymore...
Thanks a lot!
This is the farest I got. Using the following query to sort a query including all clients' details makes the second one not updateble:
Code:
SELECT T1.FKClient, T1.Calltime
FROM tblCalls AS T1
WHERE (((T1.Calltime)=(SELECT MAX(Calltime)
FROM tblCalls AS T2
WHERE T2.FKClients = T1.FKClients)))
ORDER BY T1.Data;
Last edited: