Forums
This topic is locked
Limiting search results
Posted 04 Aug 2002 01:47:47
1
has voted
04 Aug 2002 01:47:47 David Hayes posted:
I've created a forum system much like this one, and am now adding searching capabilities to it. I'm using <b>Access2k + UD4 + ASP/VBscript</b>.The search keywords are being passed from a form and used in a dynamic SQL statement to create a results recordset from an access query:
<b>"SELECT * FROM qForumSearch WHERE ThreadSubject + ThreadBody + ThreadAuthor + ReplySubject + ReplyBody + ReplyAuthor LIKE 'keyword1' OR 'keyword2' OR ..."</b>
This all works great, but what I don't like is that if certain keywords appear in multiple replies of them same thread, instead of just one instance of that thread in the recordset, I get one for every time the keyword appears in that thread.
How do I limit the results to only show one instance of each thread while still being able to search both replies and threads.
I hope this makes sense, its a little hard to explain,
Thanks,
fliquid
Replies
Replied 04 Aug 2002 03:18:52
04 Aug 2002 03:18:52 Owen Eastwick replied:
Try:
"SELECT DISTINCT * FROM qForumSearch WHERE ThreadSubject + ThreadBody + ThreadAuthor + ReplySubject + ReplyBody + ReplyAuthor LIKE 'keyword1' OR 'keyword2' OR ..."
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
"SELECT DISTINCT * FROM qForumSearch WHERE ThreadSubject + ThreadBody + ThreadAuthor + ReplySubject + ReplyBody + ReplyAuthor LIKE 'keyword1' OR 'keyword2' OR ..."
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 04 Aug 2002 05:48:33
04 Aug 2002 05:48:33 David Hayes replied:
Nope didn't work good idea though. Any other Ideas? I've never used DISTINCT before, what does it mean exactly?
Thanks,
fliquid
Thanks,
fliquid