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 ~ -----Original Message----- From: Dian D. Chapman [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 8:21 PM To: [email protected] Subject: RE: [ASP] 3rd table query, getting double returns? I managed to get the code to work, sorta, from Shawn's code. Note that the addition of "csdbo" is due to having to access this Sybase DB through "SQL Anywhere (ASA)". But this code words and pulls all the info from both tables...EXCEPT for the fact that I'm getting TWO results for each record??? Any ideas? strSearchBy = _ "SELECT csdbo.CLIENT.*, csdbo.OWNER.*, csdbo.PATIENT.* " & _ "FROM (csdbo.CLIENT INNER JOIN csdbo.OWNER ON csdbo.CLIENT.clientid = csdbo.OWNER.clientid) " & _ "INNER JOIN (csdbo.PATIENT on csdbo.OWNER.patientid = csdbo.PATIENT.patientid) " & _ "WHERE (csdbo.CLIENT.lastname = '" & varOne & "');" Tables: CLIENT (human w/clientid) PATIENT (pet w/patientid) OWNER (match for clientid to patientid) TIA for any help. Dian ~ -- This email scanned and certified clean by AVG! Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.6 - Release Date: 4/11/2005 --------------------------------------------------------------------- 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.6 - Release Date: 4/11/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/
