Eclipse Community Forums
Forum Search:

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

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] Thu, 25 October 2012 22:11 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1547
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.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:Conditional Labels for Value (Y) series
Next Topic:[chart] how to set font face to san serif
Goto Forum:
  


Current Time: Wed Jul 30 03:21:46 EDT 2014

Powered by FUDForum. Page generated in 0.03454 seconds