Hi everybody...
I want to self join the inventsum table using select statement there was no problem but when i try to convert it to query there was an error.
while select itemId,InventLocationId,InventDimId,DataAreaId,AvailPhysical from inventSum where inventSum.inventLocationId != "" exists join itemId,InventLocationId,AvailPhysical from inventSum1 where inventSum1.ItemId == inventSum.itemid && inventSum1.InventLocationId == 11 && inventSum1.AvailPhysical <= 100
I wrote this code but there was an error after execution.
query = new Query(); qbds = query.addDataSource(tableNum(InventSum)); qbr = qbds.AddRange(fieldNum(InventSum,InventLocationId)); qbr.value(SysQuery::valueNotEmptyString()); qbds1 = qbds.addDataSource(tableNum(InventSum)); qbds1.relations(true); qbds1.joinMode(JoinMode::ExistsJoin); qbr1 = qbds1.addRange(fieldNum(InventSum,InventLocationId)); qbr2 =qbds1.addRange(fieldNum(InventSum,AvailPhysical)); qbr1.value('11'); qbr2.value(strFmt('(AvailPhysical <= "%1")',100));
any help please