Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to use month as a parameter?(How to use month as a parameter?)
How to use month as a parameter? [message #1384893] Mon, 02 June 2014 19:58 Go to next message
Bob B is currently offline Bob BFriend
Messages: 5
Registered: May 2014
Junior Member
I am working on a report in which the user will need to select a month to query tables and display results for the selected month. The database is Postgres. I have set up parameters so that months are strings containing the month number (example- 01 for January, 04 for April, etc).

Here is my Where clause: WHERE date_part('month',"public"."usage_2014"."date") = ?

If I were to hard code the month it works fine, but when using the parameters I get an error, here's an excerpt from it:

Cannot get the result set metadata. org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object. SQL error #1:ERROR: operator does not exist: double precision = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 594 ; org.postgresql.util.PSQLException: ERROR: operator does not exist: double precision = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

What am I doing wrong here?
Re: How to use month as a parameter? [message #1384895 is a reply to message #1384893] Mon, 02 June 2014 20:15 Go to previous messageGo to next message
Bob B is currently offline Bob BFriend
Messages: 5
Registered: May 2014
Junior Member
Resolved, but strange. The month parameter should be numeric. I originally had the parameter values as strings. When I changed them to Integer the report worked fine. But the strange part- when I hard coded the query, I had the month in single quotes, such as '02' for February, and this worked.
Re: How to use month as a parameter? [message #1385220 is a reply to message #1384895] Thu, 05 June 2014 04:23 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Glad you got it working!

Michael

Developer Evangelist, Silanis
Previous Topic:hiding cross-tab level
Next Topic:Trouble with table name as parameter
Goto Forum:
  


Current Time: Thu Nov 23 16:50:42 GMT 2017

Powered by FUDForum. Page generated in 0.01508 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software