I have two tables, BML and Factory. The BML table contains a field called destination, which has a length of 6 characters. The Factory table contains two fields: Code (2 characters) and Name (4 characters).
We are checking the following conditions:
Factory.Codeequals the first 2 characters ofBML.destination
Factory.Nameequals characters 3 through 6 ofBML.destination
My code is as follows:
During debugging, when I include these two lines, the expected values are not being selected. I am not sure why:
&& Factory.Name == SubStr(BML.destination, 3, 4)
If I exclude these, join is working fine and data is getting selected. Data is correct, no issues in data.
while select BML
where BML.Date == systemDateGet()
&& BML.Type == MessageType::Return
join Factory
where Factory.Code== BML.AccountNum
&& Factory.Code== SubStr(BML.Destination, 1, 2)
&& Factory.Code== SubStr(BML.Destination, 3, 4)

Report
All responses (
Answers (