wiklendt
i recommend chocolate
- Local time
- Tomorrow, 00:59
- Joined
- Mar 10, 2008
- Messages
- 1,746
hi everyone,
i've made a few nested queries which find unique IDs in one query, that don't appear in another query.
to do this, i simply use the Not In () function in the criteria row of a new query. (image 1)
however, these "not in" queries take a bit of time to resolve - not usually a problem, a few seconds or tens of seconds and i have the resulting list.
now i want to make a 'basic' select query based off of two of those "not in" queries - all of which are set to return "unique values" - this is fine, still takes a little while to return the list, but ok. (image 2)
however, now i'm making a query to see which records are not in another query which is selected off a third "not-in" query. (if you get my meaning - i think what i'm doing is pretty much nesting lots of queries - don't know if this is strictly the same as a 'subquery')
now, this final query with all the 'nesting' is taking FOREVER to run (more so than the two other queries put together) and when i do get the datasheet view of that query up and try to scroll down the list to get to the bottom, it freezes access and i have to force it to close. (image 3)
my question is: am i doing this the long, not clever, or naive way? is there a better way to do these subqueries?
i need the subqueries as stand-alone queries themselves, because they are useful in their own right for my work, and referencing them via the Not In () function is 'easy'... but is it the best way to get this kind of data?
not sure whether this is relevant, but i'll mention it: some of the queries that i'm referencing in the criteria row of other queries can be based, in one shape or another on the same table...
e.g., i have a table. i make a query which selects some samples from this table. the next query selects samples from the table which do not appear in the first query.
- the thing that could suck if this is the only way to do it is that i will need to make further select queries from these, and would really prefer not to have to wait minutes for a query to run...
always needy...
agnieszka.
i've made a few nested queries which find unique IDs in one query, that don't appear in another query.
to do this, i simply use the Not In () function in the criteria row of a new query. (image 1)
however, these "not in" queries take a bit of time to resolve - not usually a problem, a few seconds or tens of seconds and i have the resulting list.
now i want to make a 'basic' select query based off of two of those "not in" queries - all of which are set to return "unique values" - this is fine, still takes a little while to return the list, but ok. (image 2)
however, now i'm making a query to see which records are not in another query which is selected off a third "not-in" query. (if you get my meaning - i think what i'm doing is pretty much nesting lots of queries - don't know if this is strictly the same as a 'subquery')
now, this final query with all the 'nesting' is taking FOREVER to run (more so than the two other queries put together) and when i do get the datasheet view of that query up and try to scroll down the list to get to the bottom, it freezes access and i have to force it to close. (image 3)
my question is: am i doing this the long, not clever, or naive way? is there a better way to do these subqueries?
i need the subqueries as stand-alone queries themselves, because they are useful in their own right for my work, and referencing them via the Not In () function is 'easy'... but is it the best way to get this kind of data?
not sure whether this is relevant, but i'll mention it: some of the queries that i'm referencing in the criteria row of other queries can be based, in one shape or another on the same table...
e.g., i have a table. i make a query which selects some samples from this table. the next query selects samples from the table which do not appear in the first query.
- the thing that could suck if this is the only way to do it is that i will need to make further select queries from these, and would really prefer not to have to wait minutes for a query to run...
always needy...
agnieszka.