Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Error - Unparseable date:
ashokraj
Hi All,
I am getting the error 'Unparseable date:' when I pass the 'Date Time' object as a parameter to the DateTimeSpan.hours() method.
Basically I want the number of hours between the current date and the 'DateTime' object that I retrieve from the database.
Code:
DateTimeSpan.hours(dataSetRow["MYDATE"], new Date())
The dataSetRow["MYDATE"] is in the format "Aug 4, 2008 1:27 PM" and this data is retrieved from Sybase database. The datatype is set as 'Date Time'.
I even tried the below
DateTimeSpan.hours(new Date(dataSetRow["MYDATE"]), new Date())
But the first parameter changes to epoch date. and not the date that is retrieved from the database.
Please help.
Find more posts tagged with
Comments
mwilliams
Hi ashokraj,
Was just about to ask you what your "date time" looks like coming in, but you updated your post right as I clicked to respond. Are you doing this in a table in your report design? What version of BIRT are you using? I'll do some testing and see if I can help.
ashokraj
I am doing it in the "Data" palette. The BIRT version is 2.2.0
mwilliams
What do you mean by "data" palette? Are you grabbing a data item from the palette and putting it in a table?
mwilliams
ashokraj,
I'm using BIRT 2.3. I have not noticed a problem using new Date() and a date field from the classic models database in the DateTimeSpan.hours() function using a data element in my table. I don't have a copy of 2.2.0 to try it in, but I do have 2.2.2. I can test it in there as well since that's closer to the version you're using. Let me know exactly what you're trying to do so I can test more accurately. If you can recreate this problem using the classic models database, so I can run your report design, that would be the best.
ashokraj
I insert the "data" item from the Palette and the expression goes like this
var duration=0;
duration= DateTimeSpan.hours(dataSetRow["NOTIFIEDAT"], new Date());
Basically I want the number of hours between the current time and the time that I get it from the database.
One more thing I am very new to BIRT. I started working on it from just 15 days.
I will be great if you could share me any link or tutorial about the expression builder.
Thanks a lot for the support.
ashokraj
Hi Michael,
The issue got resolved. The issue was that when I created the dataset and the columns I had not set the datatype for all the columns. By default all columns were of 'Any'. Later when I changed it, the issue got fixed.
Thanks a lot for you help.
Pranna
Hi,
Can you please tell how to do the validation on input parameter ?
I need to do for Date.
Thanks in advance.