SQL not working, please evaluate!
the vb.net exception is:
"incorrect syntax near '%folder containing%'."
without formatting command string looks like:
"incorrect syntax near '%folder containing%'."
select tblbase.*, tblfolders.itemid as [folder itemid], tblfiles.itemid as [file itemid], tblfiles.[file path], tblurls.itemid as [url itemid], tblurls.url, tblfaqs.itemid as [faq itemid], tblfaqs.question, tblfaqs.answer |
from tblbase left outer join tblfolders on tblbase.itemid = tblfolders.itemid left outer join tblfiles on tblbase.itemid = tblfiles.itemid left outer join tblurls on tblbase.itemid = tblurls.itemid left outer join tblfaqs on tblbase.itemid = tblfaqs.itemid |
where (tblbase.name like '%folder containing%' or tblbase.name like '%foo%') or (tblbase.description like '%folder containing%' or tblbase.description like '%foo%') or (tblfaqs.questionlike '%folder containing%' or tblfaqs.questionlike '%foo%') or (tblfaqs.answer like '%folder containing%' or tblfaqs.answer like '%foo%') |
order by tblbase.name, tblbase.[date created], tblbase.[date modified], tblbase.[date accessed] |
without formatting command string looks like:
// |
select tblbase.*, tblfolders.itemid as [folder itemid], tblfiles.itemid as [file itemid], tblfiles.[file path], tblurls.itemid as [url itemid], tblurls.url, tblfaqs.itemid as [faq itemid], tblfaqs.question, tblfaqs.answer from tblbase left outer join tblfolders on tblbase.itemid = tblfolders.itemid left outer join tblfiles on tblbase.itemid = tblfiles.itemid left outer join tblurls on tblbase.itemid = tblurls.itemid left outer join tblfaqs on tblbase.itemid = tblfaqs.itemid where (tblbase.name like '%folder containing%' or tblbase.name like '%foo%') or (tblbase.description like '%folder containing%' or tblbase.description like '%foo%') or (tblfaqs.questionlike '%folder containing%' or tblfaqs.questionlike '%foo%') or (tblfaqs.answer like '%folder containing%' or tblfaqs.answer like '%foo%') order by tblbase.name, tblbase.[date created], tblbase.[date modified], tblbase.[date accessed] |
// |
ahhhhhhhhhhhhhhh found it!!!!!!
or (tblfaqs.questionlike '%folder containing%' or
there no space before like!!
[ big sigh of relief!!! ]
thanks trying though!
SQL Server > SQL Server Express
Comments
Post a Comment