Thanks, David. 

The way this is setup, the user enters a person's last name to see all the
client's w/that last name, address, to find John Smith. Then the next dlg
shows John Smith's info and all his pets. 

I have the first part working now...so if John Smith has 4 pets, he only
shows up one time, versus 4 times. Now I need to match up and list all the
pets in a listbox and I'm getting a syntax error that says "Syntax error
near "."" And with a dozen "." in the query...it's a joy trying to figure
out what is wrong!<sigh> 

I spend a few hours last night reading sample query stuff and will try to
break it down today. I think I may know what I need now...if not, I'll be
back screaming!<g> 

Dian ~

-----Original Message-----
From: David Smart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 13, 2005 12:34 AM
To: [email protected]
Subject: Re: [ASP] 3rd table query, getting double returns?


I would have assumed that was what you wanted - i.e. "Are you the Mr Smith
that owns Freddy the frog?".  You would need to return one record per pet,
with owners appearing as many times as they had pets.  Otherwise, why link
to the pet table at all here?

However, once you cut down on the fields you actually want to see, if you
then have multiple retrievals that are exactly the same, you can use
"distinct" to eliminate the duplicates.

Obviously, if you're only looking for the Mr Smith's that have dogs, you can
use a where test on the pet table to select by pet type.

PS, it's not really the third table that's doing this.  If you simply keyed
the pet table with the owner's full name, you'd still get the same thing,
because multiple pet records would have the same owner.

Do you have a problem with broken homes - i.e. the same pet has two owners?
That'd really get the hair pulling going.  :-)

Dave S

----- Original Message ----- 
From: "Dian D. Chapman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 13, 2005 11:44 AM
Subject: RE: [ASP] 3rd table query, getting double returns?


>
> Further to the item below...I just messed with the query in the ASA query
> editor and realized I'm getting TWO client lists, due to the fact that
each
> (of this sample data) happens to have two pets. So it is pulling two
client
> names due to the fact that there are two patient matches in that 3rd
> matching table.
>
> So it's saying...here's one match, here's another, due to the two
clientIDs
> in the OWNER table...one for the owner's dog, one for the owner's cat.
>
> ARRGGHHH! Why the hell do devs use this third table!<grrrrr>
>
> TIA for any help!
>
> Dian ~



---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [email protected]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links



 




-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.6 - Release Date: 4/11/2005
 

-- 
This email scanned and certified clean by AVG!
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005
 



---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [email protected]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to