[AccessD] query to slow

Gustav Brock Gustav at cactus.dk
Tue Sep 28 10:28:42 CDT 2010


Hi Pedro

Why not just:

SELECT 
  Patientnr, 
  Max(UitvoerDatum) As UitvoerDatumLast
FROM 
  qryKreatinine
GROUP BY
  Patientnr;

/gustav


>>> pedro at plex.nl 28-09-2010 17:04 >>>
Dear List,

i have a query <qryKreatinine> with about 400000 records.
This query contains patientnumbers and dates


<qryKreatinine>
Patientnr   UitvoerDatum
01000616    1-6-2009
01000616    29-7-2009
01000661    1-5-2010
01000661    3-6-2010
01000661    3-6-2010
01000832    11-9-2009
01000832    17-9-2009
01000832    1-3-2010

I need to have for each Patientnumber, the last date (see final result).
I did this with two queries (see below), but only with low number queries (a few thousand records.
With more then 500000 records it takes to much time to get the result.

Can i do this with 1 query in a normal time span for 400000 records??


Thanks

Pedro






More information about the AccessD mailing list