Re: What does this query do?
- From: mbpatpas@xxxxxxxxxxxxxxxxxxx (Mike Preston)
- Date: Thu, 29 Sep 2005 11:47:28 GMT
On Thu, 29 Sep 2005 10:50:06 +0100, "Keith"
<keith.wilby@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>I've inherited an Access file in which there is the following query:
>
>SELECT tblItem.InstanceNo, "PL" &
>Left([tblItem].[Label],InStr([tblItem].[Label],"-")-1) AS Parent
>FROM tblItem, tblItem AS tblItem_1
>WHERE ((("PL" &
>Left([tblItem].[Label],InStr([tblItem].[Label],"-")-1))=[tblItem_1].[InstanceNo]));
>
>So the same table is included twice and [InstanceNo] is used as criteria for
>[Parent]. I would have thought that the query would return two identical
>columns but it doesn't. My brain's not working today, which part of the
>plot am I missing?
I would guess that it lists the Instance and Parent for each Parent
row that exists with respect to any row of the table. So, assume you
have 40 rows in the table. Assume that for a given row, say 39, the
Parent is defined as "PL001"; that is, the Label starts with "001-".
Row 39 is displayed once for each row of the 40 rows where Instance =
"PL001".
If row 39 is defining the parent for Instance number 859 (Instance =
"PL859") as "001" (Label starts with "001-") then list row 39 once for
each row in the table where Instance = "PL001".
mike
.
- References:
- What does this query do?
- From: Keith
- What does this query do?
- Prev by Date: Re: Strange Email Problem
- Next by Date: Re: What does this query do?
- Previous by thread: What does this query do?
- Next by thread: Re: What does this query do?
- Index(es):
Relevant Pages
|
|