>Queries work great. Two things I'm hitting though are: 1) Deleted records in the KWRDLINK table are pulling up, which means the keyword isn't valid anymore for that photo, and 2) Keywords are pulling photos on a Keyword1 OR Keyword2 OR Keyword3 instead of a Keyword1 AND Keyword2 AND Keyword3.
>
>Thanks for your help with this! Makes the code much much much more readable!
ad 1) add "and !deleted()" to the where clause where you pull from the kwrdlink
ad 2) you may want to add a
Group By pictureid having cnt(pictureid)>=numberofkeywords
clause to your last SQL, so it will pull only those which have them all. The numberofkeywords would be the recordcount of the first cursor (where we did the Append From).