I am using the command object that has a sql statement with a union clause against a FoxPro database. When I run the report it doesn not return all of the valid records. However, when I run the exact same sql in FoxPro, I get the desired results (the missing records appear). Does anyone have any comments on why this is or suggestions on how to resolve this? I am using CR9.2.
Here is the statement:
Here is the statement:
Code:
SELECT `icytrn30`.`item`,`icitem30`.`itmdesc`, `icitem30`.`stkumid`, `icunms30`.`cnvf`, `icytrn30`.`tqty`, `icytrn30`.`applid`, `icytrn30`.`tdate`, `icitem30`.`itmclss`, `icytrn30`.`tcost`, `icytrn30`.`trantyp`
FROM (`icunms30` `icunms30` INNER JOIN `icitem30` `icitem30` ON `icunms30`.`umsconv`=`icitem30`.`stkumid`) INNER JOIN `icytrn30` `icytrn30` ON `icitem30`.`item`=`icytrn30`.`item`
WHERE `icytrn30`.`applid`='PP' AND (`icytrn30`.`tdate`>={d '2004-09-28'} AND `icytrn30`.`tdate`<={d '2004-10-23'}) AND `icytrn30`.`item`='405100'
AND `icytrn30`.`trantyp`=' R'
Union
SELECT `ictran30`.`item`,`icitem30`.`itmdesc`, `icitem30`.`stkumid`, `icunms30`.`cnvf`, `ictran30`.`tqty`, `ictran30`.`applid`, `ictran30`.`tdate`, `icitem30`.`itmclss`, `ictran30`.`tcost`, `ictran30`.`trantyp`
FROM (`icunms30` `icunms30` INNER JOIN `icitem30` `icitem30` ON `icunms30`.`umsconv`=`icitem30`.`stkumid`) INNER JOIN `ictran30` `ictran30` ON `icitem30`.`item`=`ictran30`.`item`
WHERE `ictran30`.`applid`='PP' AND (`ictran30`.`tdate`>={d '2004-09-28'} AND `ictran30`.`tdate`<={d '2004-10-23'}) AND `ictran30`.`item`='405100'
AND `ictran30`.`trantyp`=' R'