![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Update: I changed the query to read: SELECT qryEndingEventDate.EventID, qryEndingEventDate.EventTagNumber, qryEndingEventDate.EventDate, qryEndingEventDate.EventType FROM qryEndingEventDate WHERE (((qryEndingEventDate.EventID) In (SELECT TOP 1 dupe.EventID FROM qryEndingEventDate as dupe WHERE dupe.EventTagNumber = qryendingeventdate.EventTagNumber AND (dupe.EventType='foo' Or dupe.EventType='foo2') ORDER BY dupe.EventDate DESC))); and it worked... happy dance, happy dance... Now the problem is that its dog-awful slow. The db has about 7000 TagNumbers and the response time is worse than the class module I had tried... Suggestions would be much appreciated... |
#4
| |||
| |||
|
|
Since both the main query and the subquery seem to be using qryEndingEventDate as source, you are running a query into a query that, for every record must run a subquery into a query. If that's too slow, you could use a temporary table to solve the problem. That is, turn qryEndingEventDate into an Append query (or Make Table initially), with suitable indexes on the criteria fields. Then use this table as the source for the final query instead of qryEndingEventDate. -- Allen Browne - Microsoft MVP. *Perth, Western Australia Tips for Access users -http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Tom" <rtmn... (AT) swbell (DOT) net> wrote in message news:af5d7bf9-1ce4-43cf-8f68-3a6c75f914a8 (AT) t8g2000yqk (DOT) googlegroups.com... Update: I changed the query to read: SELECT qryEndingEventDate.EventID, qryEndingEventDate.EventTagNumber, qryEndingEventDate.EventDate, qryEndingEventDate.EventType FROM qryEndingEventDate WHERE (((qryEndingEventDate.EventID) In (SELECT TOP 1 dupe.EventID FROM qryEndingEventDate as dupe WHERE dupe.EventTagNumber = qryendingeventdate.EventTagNumber *AND (dupe.EventType='foo' Or dupe.EventType='foo2') *ORDER BY dupe.EventDate DESC))); and it worked... happy dance, happy dance... Now the problem is that its dog-awful slow. *The db has about 7000 TagNumbers and the response time is worse than the class module I had tried... Suggestions would be much appreciated... |
![]() |
| Thread Tools | |
| Display Modes | |
| |