G
Guest
I have a select query that is providing the desired results. The only problem is that it is very slow when using it with other queries or reports… it takes up to an hour to process. My actual data table contains about 1,700 records. If I run the query by itself, it takes less than a minute. I have also tried to run it as a “make a table queryâ€, but that takes over an hour as well. Any ideas on why it is so slow
My select query
SELECT T.ID, T.DownCode, (SELECT DownCode FROM DownCode WHERE ID = (SELECT Max(ID) FROM DownCode T1 WHERE T1.ID < T.ID)) AS PrevDownCod
FROM DownCode AS T
Nic
My select query
SELECT T.ID, T.DownCode, (SELECT DownCode FROM DownCode WHERE ID = (SELECT Max(ID) FROM DownCode T1 WHERE T1.ID < T.ID)) AS PrevDownCod
FROM DownCode AS T
Nic