473,396 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Correllated Subquery, unresolving outer references

I'm trying to form a correlated subquery (right now, it's MS Access
running to linked tables in MS SQL, although I have tried to make the
same query against the MS SQL tables directly).

The goal in the query below is to filter out near-duplicates.

What I have is similar rows in my database, and the differences between
the different rows lies in a date field. I want to be able to filter
out the "newest" dates

What happens is that Access treats all of the references in the
subquery as variables to be filled (and so prompts me), but if I use
the full table name, it defeats the purpose of a corellated subquery
(namely, to be able to use an outer reference).

SELECT dbo_ace_sites.longName, dbo_ace_taskCore.onsiteDate,
dbo_ace_taskCore.status
FROM dbo_ace_taskCore AS A1, dbo_ace_sites AS A2
WHERE (((A1.site)=[A2].[shortCode]) AND [A1].[onsiteDate] Between
DateValue("1/1/2006") and DateValue("7/1/2006") AND
(([dbo_ace_taskCore].[onsiteDate]) In (select Max(A1.onsiteDate)
FROM dbo_ace_taskCore A3 WHERE A3.shortCode = A1.shortCode )));

I'd love either a explanation of what's going wrong here, or how to fix
it, or a link explaining exactly how to write outer references with MS
SQL/Access (and the guide at
http://www.aspfree.com/c/a/MS-SQL-Se...Expressions/2/
isn't the proper syntax).

Thanks

Aug 3 '06 #1
0 1260

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: olanorm | last post by:
I have a query where one or more of the columns returned is a result from a subquery. These columns get their own alias. I want to filter out the rows containing NULL from the subqueries but it...
1
by: LazyAnt | last post by:
Does DB2 process "ALL" subquery by "nested iteration" strategy, or using its own special algorithm? For example, assume r(A, B, C) and s(D, E, F) are two relations, consider the following query:...
22
by: Kevin Murphy | last post by:
I'm using PG 7.4.3 on Mac OS X. I am disappointed with the performance of queries like 'select foo from bar where baz in (subquery)', or updates like 'update bar set foo = 2 where baz in...
5
by: No bother | last post by:
I am using 5.0.26-NT on Windows 2000. I have need to use a reference in the outer from clause in a subquery in the select clause. Consider the following example: Select (select b.baitID from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.