>thisform.grdBook.Recordsource = '' >select * from TBook ; > where upper(cTitle) like '%'+upper(lcKeyWord)+'%' ; > into cursor crsBooks >if _Tally = 0 > select * from TBook ; > inner join Tcode ; > on upper(Tbook.Title) like '%'+upper(trim(Tcode.Code))+'%' ; > into cursor crsBooks >endif >thisform.grdBook.Recordsource = 'crsBooks' >Cetin
if _tally = 0 && We can not find a book by the keyword provided, let's look for "similar" keywords select t1.cWord from TCode t1 ; inner join TCode t2 on t1.cCode = t2.cCode ; where upper(t2.cWord) == upper(lcKeyWord) ; and upper(t1.cWord)<>upper(lcKeyWord) ; into cursor curMetaphones && Have doubts, if I write this select right, * the idea is to select all keywords except the original keyword * with the same code as the code for the passed keyword. * If this select would not work, it's easy to do in two selects. if _tally >0 && e.g. there are metaphones * Now we need to check TBook against each found keyword. *Should be done in one select rather than in the loop. How should it be done? endif endifHere is the idea of the filter, as I see it. But what is the solution?