Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query question

Author  Topic 

angelo05328390
Starting Member

1 Post

Posted - 2009-03-01 : 10:23:17
how can i get values referring to multiple foreign input? here is my query im using 2 tables and the query will be used in a auto complete search.

"Select connection.[Transaction],connection.[Membership No],connection.[Status],member.[Member],connection.[Contract Date] From member,connection where connection.[Membership No]=member.[Membership No] AND connection.[Membership No] = (Select [Membership No] from member where Member Like '" + input + "%')and connection.[Status]='Installed'";

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-01 : 11:49:56
[code]SELECT connection.[Transaction],
connection.[Membership No],
connection.[Status],
m.Member,
connection.[Contract Date]
FROM Member AS m
INNER JOIN Connection AS c ON c.[Membership No] = m.[Membership No]
AND c.[Status] = 'Installed'
WHERE m.Member LIKE @input + '%'[/code]


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 09:12:00
are you using the query from some application?
Go to Top of Page
   

- Advertisement -