Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT- date manipulation for query(BIRT- date manipulation for query)
BIRT- date manipulation for query [message #956740] Wed, 24 October 2012 19:23 Go to next message
Radhika Gopinath is currently offline Radhika GopinathFriend
Messages: 1
Registered: October 2012
Junior Member

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.
Re: BIRT- date manipulation for query [message #958470 is a reply to message #956740] Fri, 26 October 2012 02:11 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

The error you're getting is because the parameter value is going to the original '?' marker in your query. If you change the original query to:

select user_id, claimdate from Claims where status='A'

that error should go away.


Developer Evangelist, Silanis
Previous Topic:pie chart sorting
Next Topic:[chart] how to set font face to san serif
Goto Forum:

Current Time: Thu Feb 09 00:53:24 GMT 2023

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

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

Back to the top