Function fSeekpair ** determine if cPerson_id has bought all the items in ItemsArray ** Purchase table has an index on cPerson_id+cItem_id. ItemsArray is an array of cItem_id Parameters cPerson_id, ItemsArray, nArraySize Local nCnt, lPairFound nCnt = 1 lPairFound = .T. Do While nCnt <= nArraysize.AND.lPairFound lPairFound=Seek(cPerson_id+aItemsArray[li,1],'PURCHASE','Person_Item') .AND. lPairFound li=li+1 EndDo Return lPairFoundTo get all people who bought the n items in aItemsArray
Select cPerson_id from PERSONS where fseekpair(cPerson_id,@Itemlist,Itemlistnumber) ; into cursor somethingI will try David's approach since it does look much cleaner but I'm still trying to figure out