Re: 2 Queries need to combine into one

2009-11-10 Thread Ananda Kumar
select (SELECT dealer.FIRMID, (COUNT(*) -1) * 25.00 + 270.00 AS FEE FROM `dealer` `dealer` INNER JOIN `branches` `branches` ON (`branches`.`FIRMID` = `dealer`.`FIRMID`) WHERE (( `dealer`.`CRD_NUM` = 0 ) OR ( `dealer`.`CRD_NUM` IS NULL )) AND ( `dealer`.`LIC_TYPE` IN

Re: 2 Queries need to combine into one

2009-11-10 Thread Robin Brady
Initially I received the operand should only have one column so I removed the dealer.FIRMID from the select statement and then the query just returns NULL. Each query works fine on its own but I can't seem to combine it so that is gives me the total of the fees. Robin Ananda Kumar

Re: 2 Queries need to combine into one

2009-11-10 Thread Peter Brawley
Robin, select (SELECT dealer.FIRMID, (COUNT(*) -1) * 25.00 + 270.00 AS FEE FROM `dealer` `dealer` INNER JOIN `branches` `branches` ON (`branches`.`FIRMID` = `dealer`.`FIRMID`) WHERE (( `dealer`.`CRD_NUM` = 0 ) OR ( `dealer`.`CRD_NUM` IS NULL )) AND ( `dealer`.`LIC_TYPE` IN

Re: 2 Queries need to combine into one

2009-11-10 Thread Ananda Kumar
select * from a; +--+ | id | +--+ |1 | |2 | +--+ 2 rows in set (0.00 sec) mysql select * from b; +--+ | id | +--+ |1 | |2 | +--+ 2 rows in set (0.00 sec) mysql mysql select (select id from a where id=1) + (select id from b where id=1);

2 Queries need to combine into one

2009-11-09 Thread Robin Brady
I am very new to MySQL and trying to use Navicat Report Builder to format a renewal invoice to send to our registrants. The renewal fees are fixed for each type of registrant but the actual fee is not part of the database and must be computed as the report is generated. As far as I can tell,