.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

SQL Help

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net
 
SELECT WebUploadLog.ID, WebUploadLog.Title, DMDProfile.ProfileName  
FROM WebUploadLog INNER JOIN DMDProfile
      ON WebUploadLog.ProfileID = DMDProfile.ID
      WHERE WebUploadLog.UserID = @UserID AND 
      (WebUploadLog.Title LIKE '%' + @Search + '%' 
      OR DMDProfile.ProfileName LIKE '%' + @Search + '%')


 The sql above just returns the matches from the first table (matches on Title field), While I expected that it get me also matches from second table (ProfileName field), seems like the or is not working.

How do I correct this sql so that matches from either table returned?




View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend