Join transfer of subsets of information

I’m half expecting you to tell me I’m trying to use the join statement for something it can’t do, but just in case that’s not the case, I’ll pose the question:

I’m using the join statement to transfer information between databases. I am wanting to transfer a subset based on 2 criteria, but the programme seems to ignore the second criteria. This is my formula:

join 
"DATABASE","Cattle Database",
"APPEND","YES",
"NOMATCH","",
"«Unique»","Unique",
"REPLACEEXISTING","YES",
"MATCHINGFIELDS","NO",
"KEY","Unique",
"«PregEmpty»","TempText3",
"«PregTestDate»",date(dDate),
"source subset",{Check="Y" and "TempText3"<>""}
zlog "preg"

join 
"DATABASE","Cattle Database",
"APPEND","YES",
"NOMATCH","",
"«Unique»","Unique",
"REPLACEEXISTING","YES",
"MATCHINGFIELDS","NO",
"KEY","Unique",
"«Mouth»","TempText4",
"«DateMouthed»",date(dDate),
"source subset",{Check="Y" and "TempText4"<>""}
zlog "mouth"

join 
"DATABASE","Cattle Database",
"APPEND","YES",
"NOMATCH","",
"«Unique»","Unique",
"REPLACEEXISTING","YES",
"MATCHINGFIELDS","NO",
"KEY","Unique",
"«Sell»","TempText5",
"source subset",{Check="Y" and "TempText5"="TRUE"}
zlog "sell"

I have tried listing each criteria as its own “source subset”, but then it selects ‘either/or’ rather than ‘both’.

The reason I am trying to do it this way, is that if I simply join all the data I am importing, I overwrite previously populated fields with empty fields… eg if an animal was pregnancy tested 3 months ago, but not this time, that information will be overwritten

When you write something like

"TempText3"<>""

you are not comparing the content of the TempText3 field to an empty string. You are comparing that literal string of 9 characters to an empty string, and they are guaranteed to be unequal. You need to remove the quotes from TempText3, TempText4, and TempText5.

That was not what I was expecting. Thanks very much Dave.