B
bobg.hahc
running access 2k; the mdb I'm using has no local tables - all are
link to a back-end mdb, and a sql-server.
I'm trying to run a find duplicates query, but when I link to a sql-
server linked table, it locks up solid.
Here's the basic query - which works just fine (I'm using 'AS
V_contacts' to make sure that access isn't confusing tables):
SELECT V_contacts.last_name, V_contacts.first_name
FROM T_contacts AS V_contacts
WHERE (((V_contacts.last_name)
In (SELECT [last_name] FROM [T_contacts] As Tmp GROUP BY [last_name],
[first_name] HAVING Count(*)>1 And [first_name] = [V_contacts].
[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
Now - I want to see additional related information from this query, so
I add an mdb based order table - This query works PERFECTLY:
SELECT V_contacts.last_name, V_contacts.first_name,
T_orders.order_number
FROM T_contacts AS V_contacts LEFT JOIN T_orders ON
V_contacts.contact_id = T_orders.contact_id
WHERE (((V_contacts.last_name) In (SELECT [last_name] FROM
[T_contacts] As Tmp GROUP BY [last_name],[first_name] HAVING
Count(*)>1 And [first_name] = [V_contacts].[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
So - now I want to do EXACTLY the same thing with a table that happens
to be a link to a sql-server table - This query NEVER RUNS!!!????:
SELECT V_contacts.last_name, V_contacts.first_name,
dbo_T_login.user_id
FROM T_contacts AS V_contacts LEFT JOIN dbo_T_login ON
V_contacts.contact_id = dbo_T_login.cid
WHERE (((V_contacts.last_name) In (SELECT [last_name] FROM
[T_contacts] As Tmp GROUP BY [last_name],[first_name] HAVING
Count(*)>1 And [first_name] = [V_contacts].[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
Not that it needs it, but the sql table IS indexed on the joined
field.
What could possibly be access's problem when trying to talk to another
microsoft product????
TIA - Bob
link to a back-end mdb, and a sql-server.
I'm trying to run a find duplicates query, but when I link to a sql-
server linked table, it locks up solid.
Here's the basic query - which works just fine (I'm using 'AS
V_contacts' to make sure that access isn't confusing tables):
SELECT V_contacts.last_name, V_contacts.first_name
FROM T_contacts AS V_contacts
WHERE (((V_contacts.last_name)
In (SELECT [last_name] FROM [T_contacts] As Tmp GROUP BY [last_name],
[first_name] HAVING Count(*)>1 And [first_name] = [V_contacts].
[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
Now - I want to see additional related information from this query, so
I add an mdb based order table - This query works PERFECTLY:
SELECT V_contacts.last_name, V_contacts.first_name,
T_orders.order_number
FROM T_contacts AS V_contacts LEFT JOIN T_orders ON
V_contacts.contact_id = T_orders.contact_id
WHERE (((V_contacts.last_name) In (SELECT [last_name] FROM
[T_contacts] As Tmp GROUP BY [last_name],[first_name] HAVING
Count(*)>1 And [first_name] = [V_contacts].[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
So - now I want to do EXACTLY the same thing with a table that happens
to be a link to a sql-server table - This query NEVER RUNS!!!????:
SELECT V_contacts.last_name, V_contacts.first_name,
dbo_T_login.user_id
FROM T_contacts AS V_contacts LEFT JOIN dbo_T_login ON
V_contacts.contact_id = dbo_T_login.cid
WHERE (((V_contacts.last_name) In (SELECT [last_name] FROM
[T_contacts] As Tmp GROUP BY [last_name],[first_name] HAVING
Count(*)>1 And [first_name] = [V_contacts].[first_name])))
ORDER BY V_contacts.last_name, V_contacts.first_name;
Not that it needs it, but the sql table IS indexed on the joined
field.
What could possibly be access's problem when trying to talk to another
microsoft product????
TIA - Bob