ian.mcdian Posted September 25, 2012 Share Posted September 25, 2012 Background, I finally figured out how to get iReport to connect to my SQLite database on my OpenSuSE 12.2 x86_64 system. And now I am learning how to use iReport so as to eventually replace CrystalReports and therefore eliminate the need for me to run Windows in a VM instance.Right now I am able to get data using simple queries but when I attempt more complex queries I get this error message:Error: SQL problems: no such column: tblRteComp.rteStatusBut the table and the column do exist so I am a bit puzzled as to why iReport thinks it doesn't.Here is the SQL I am usingSELECT * FROM tblHistory WHERE tblHistory.yerPer='201208' AND tblRteComp.rteStatus='Loaded' ORDER BY tblHistory.metId ASCIf I remove the clause for tblRteComp.rteStatus='Loaded' or just remove the portion that identifies the column in question the error goes away and it works. Ideas? Link to comment Share on other sites More sharing options...
ian.mcdian Posted September 25, 2012 Author Share Posted September 25, 2012 Never mind... I figured it out! SELECT * FROM tblHistory,tblRteComp WHERE tblHistory.yerPer=$P{yerPer} AND tblRteComp.rteStatus='Loaded' ORDER BY tblHistory.metId ASC Link to comment Share on other sites More sharing options...
pioppogatto Posted September 26, 2012 Share Posted September 26, 2012 Join condition between the two tables? Link to comment Share on other sites More sharing options...
butlerc Posted September 26, 2012 Share Posted September 26, 2012 Your SQL Query only has one table in the FROM tblHistory in your WHERE clause you are referencing a different table tblRteComp.rteStatus. Add tblRteComp to your FROM and then add join between the tables in the WHERE clause Link to comment Share on other sites More sharing options...
ecanaveras Posted September 26, 2012 Share Posted September 26, 2012 The error occurs because your SQL statement is not correct Use: SELECT * FROM TABLA_1 T1, TABLA_2 T2 WHERE T1.KEY=T2.KEY AND T1.YERPER=$P{yerPer} ORDER... Bye Link to comment Share on other sites More sharing options...
ecanaveras Posted September 28, 2012 Share Posted September 28, 2012 The error occurs because your SQL statement is not correct! Use: SELECT * FROM TABLA_1 T1, TABLA_2 T2 WHERE T1.KEY=T2.KEY AND T1.YERPER=$P{yerPer} ORDER... Bye Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now