Access World Forums

Access World Forums (https://www.access-programmers.co.uk/forums/index.php)
-   Queries (https://www.access-programmers.co.uk/forums/forumdisplay.php?f=8)
-   -   ODBC puzzle (https://www.access-programmers.co.uk/forums/showthread.php?t=279590)

dougiej 07-28-2015 12:40 AM

ODBC puzzle
 
I have a query which looks at a linked table (ODBC to SQL Server) in order to return a list of sub-accounts associated with an account. If I run it as a pass-through query it executes correctly, returning a list of the sub-accounts. If I run it as a query in Access it return the correct number of records but each sub account has the same name as the main account, as follows.

Result of pass through:
Main Sub
A X
A Y
A Z

Same SQL in Access:
Main Sub
A A
A A
A A

dougiej 07-28-2015 02:12 AM

Re: ODBC puzzle
 
Found it myself. The linked table is actually a view, and I had specified a unique field on the ODBC link when there is none. Not specifying any field as unique on linking removed the problem.


All times are GMT -8. The time now is 07:14 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World