Min function not working for minimum date [message #344310] |
Fri, 29 August 2008 06:29 |
ken.nessworthy@apollo-med
Messages: 3 Registered: August 2008
|
Junior Member |
|
|
Hi All,
I have a simple query that should return the first date but instead is returning all the dates in a table...
Can someone tell me where I am going wrong
Query
SELECT qs.clientid, min(qs.responded)
FROM querystatus qs, activequery aq
WHERE qs.queryid = aq.queryid
AND aq.guid = '{92AC13C5-CF44-478E-AD46-737C1077922D}'
AND qs.clientid = 909
GROUP BY qs.responded, qs.clientid
ORDER BY 2
Returned
CLIENTID MIN(QS.RESPONDED)
----------- --------------------
909 08/02/2008 05:39:36
909 30/03/2008 19:54:28
909 19/04/2008 11:39:45
909 20/04/2008 12:50:55
909 20/04/2008 18:03:59
909 08/06/2008 23:39:45
909 15/06/2008 19:18:12
909 19/06/2008 07:01:45
909 22/06/2008 21:02:22
I only require the first record.
Kind regards
Ken
|
|
|
|
|
|
|
|
|
|