Hi
I think you should have command object in your Database Expert window when you initially created the report to select the tables.
*Click The connection and expand it to find Add Command,double click to enter the SQL
*In the Command window paste the SQL
as you have written in the post
select * from address where cust_code = 1001 and address_id in (select max(address_id) from address where cust_code = 1001)
I would suggest to use the column names which are needed in the report instead of * to avoid entire table scan.
*Another suggestion would be to create view or stored proc at backend and use that instead of the tables.
* Then select the fields which you want in the report.
Cheers
Rahul
Edited by rahulwalawalkar - 30 Jun 2010 at 2:27am