|BIRT- date manipulation for query [message #956740]
||Wed, 24 October 2012 15:23
| Radhika Gopinath
Registered: October 2012
I am new to BIRT and struggling with an issue that might be simple but has me stumped.
I need to get the list of people who have applied for a claim from start of the the year to the given date.
I have 1 input parameter - as_of_date which I accept from the user.
I need to identify the start of the year date and create my query to fetch results between the 2 dates.
This is what i tried.
1. In the query, I entered the query as
select user_id, claimdate from Claims where status='A' and claimdate > ?
In Property Binding,
var thisdate = params["as_of_date"].value;
var formattedDate = thisdate.getYear() + '-' + thisdate.getMonth() + '-' + thisdate.getDate();
var yearStartDate = thisdate.getYear() + '01-01';
"select user_id, claimdate from Claims where status='A' and claimdate >= " + yearStartDate + " and claimdate <= " + formattedDate;
I run the report and enter the date as 2012-10-25 and I get the exception :
Cannot set the date value (2012-10-25 00:00) to parameter 1.
Cannot set preparedStatement parameter date value.
SQL error #1: Descriptor index not valid.
The query is adding the time stamp to my date.Please help.
Powered by FUDForum
. Page generated in 0.02407 seconds