Good contributions here.
1. The biggest problem here is that you try to take a general example (read idea) and use it directly.
temp Position := StringFind (Table1 Year, temp Year model) .
This one make no sense as you check the source table for itself. temp year is Table1 Year.
temp Position := StringFind ("Text data", temp Mark) .
Here you check if there is temp mark in the string "Text data" this will only be true if temp mark is either "Text" or "data" or any of the letters in this string.
Understanding is everything in programming. You need to invest the time to understand the functions you use then it will be easy to make the program you want.
StringFind will look for a substring in a string. So StringFind("this is a test","test") will return the start position of "test" will stringfind ("This is a test","For") will return 0 .
Anyhow the DQL so kindly provided by Mr. Nerland might be a little excessive for what you need.
define "dirty" text .
for Table1 ;
dirty := "no" .
if stringfind(YrMkMod ,Table1 Year )>0 then
if stringfind(YrMkMod ,Table1 Make )>0 then
if stringfind(YrMkMod ,Table1 Model )>0 then
dirty := "yes" .
Flag := dirty .
Here we loop table 1 and then loop through all Table2 records for Year,Make,Model. Here we also address another issue with the previous DQL. It reset counter so its enough if the last record in Table2 is not a match and counter will be 0 as you don't have an overall flag for the run through.
Dirty is reset before each loop of table2 so if its gets yes on record1 it stay yes even thought the rest is no.
Then we simply modify the record in table1 with yes or no and hence you don't need to reset anything if things change as if things change you will get a yes or a no directly.
DE9 is soon her with many new challenges ;-)