Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtered the 2nd table based on the result of 1st table
Message
 
 
To
08/08/2003 09:50:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00818131
Message ID:
00818396
Views:
19
>I think I still couldn't understand it right. Will try with the part I could understand :
>
>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

Hi Cetin,

I think, I understood the problem differently, but I don't see a simple solution at this moment.

The first select is the same.
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
endif
Here is the idea of the filter, as I see it. But what is the solution?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform