keywords = txtSearch.Text
sqlStr = "SELECT tblBooks.fldTitle, tblBooks.fldAuthor, tblBooks.fldISBN, tblBooks.fldNoCopies, tblBooks.fldInStock,
tblCat.fldCatName FROM tblBooks INNER JOIN tblCat ON tblBooks.fldCatID = tblCat.fldCatID
WHERE ((fldTitle LIKE '%'+ @keywords+'%')
Or (fldAuthor LIKE '%'+ @keywords+'%')
Or (fldCatName LIKE '%'+ @keywords+'%')
Or (fldISBN LIKE '%'+ @keywords+'%' )
) Or (@keywords IS NULL) )
ORDER BY tblBooks.fldTitle
"
limno
All-Star
117340 Points
8005 Posts
Moderator
MVP
Re: sql commnd query strings
Apr 29, 2012 06:31 PM|LINK
Format your SQL query with instant sql formatter:
http://www.dpriver.com/pp/sqlformat.htm