Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Left Join syntax error

Status
Not open for further replies.

pen81

Programmer
Oct 27, 2004
62
GB
I get a "Failed to open rowset" error because the following SQL code is incorrect:

Code:
 SELECT `account`.`division`, `groupTopLevelBS`.`division`, `groupNameBS`.`division`, `groupAccountBS`.`division`, `account`.`month`, `account`.`year`, `groupTopLevelBS`.`groupid`, `groupTopLevelBS`.`name`, `groupNameBS`.`groupid`, `groupNameBS`.`name`, `account`.`balancesheet`, `account`.`bs_cumm`, `account`.`title`, `tempBS`.`under`
 FROM   {oj (((`development-accounts`.`groupTopLevelBS` `groupTopLevelBS` INNER JOIN `development-accounts`.`groupNameBS` `groupNameBS` ON `groupTopLevelBS`.`groupid`=`groupNameBS`.`tlgroupid`) INNER JOIN `development-accounts`.`groupAccountBS` `groupAccountBS` ON (`groupNameBS`.`tlgroupid`=`groupAccountBS`.`tlgroupid`) AND (`groupNameBS`.`groupid`=`groupAccountBS`.`groupid`)) INNER JOIN `development-accounts`.`account` `account` ON `groupAccountBS`.`accountNumber`=`account`.`account`) LEFT OUTER JOIN `development-accounts`.`tempBS` `tempBS` ON `account`.`account`=`tempBS`.`account`}
 WHERE  `account`.`division`='L' AND `groupTopLevelBS`.`division`='L' AND `groupNameBS`.`division`='L' AND `groupAccountBS`.`division`='L' AND `account`.`month`=9 AND `account`.`year`=2005
 ORDER BY `groupTopLevelBS`.`groupid`, `groupNameBS`.`groupid`

This is caused by the {oj .... } around the FROM clause. When I copy the SQL into my SQL client and remove the {oj ... } the query works and returns exactly what I need.

I am using CR10 and MySQL 3.23.43, and MySQL ODBC 3.51 driver.

I assume you cannot change the SQL query within Crystal but cannot see another way round this problem.
 
If you want to place a query in CR10 you must use the add command option which is available at the beginning of the creation of the report.

Mo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top