Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Date format to pass parameter
sumathra
<p>Hi i had a oracle databases <strong>params["Date"].value</strong> as Date type in that value contain like <strong>2014-03-01</strong> so now i have to append in dataset like <strong>"</strong><span style="font-size:14px;"><strong>BirtDateTime.month(params["Date"].value)"</strong> it pass to query like <strong>"3"</strong> but i have to pass to like<strong> </strong></span><strong><span style="font-size:14px;">'MAR' </span></strong><span style="font-size:14px;">so how to Extract string and pass to query</span></p>
Find more posts tagged with
Comments
minthril
<p>Hello sumathra!
I am not sure if I understand correctly byt maybe it will help you (or at least bring someone wiser to correct me
).
Try something like this in expression (little changes needed to fit 3 char long):
var monthNames = [ "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" ]
x = monthNames[(params["Date"].getMonth())]
Hope that helps you
Best regards,
minthril</p>
micajblock
<p>What is the data type of the Oracle field?</p>
sumathra
<p>
@minthril
thanks for u r reply i am getting this error while running the report </p><p> </p><div><strong class='bbc'><span>org.eclipse.birt.report.exception.ViewerValidationException: The parameter "date" is invalid. The value "13.05.2014" is invalid with the type "date".</span></strong></div><p> </p><p>
@mblock<
;/p><p> </p><p>Date Data-type is "Date Time" format</p><p> </p><p><strong>TRAN_DATE<span> </span></strong></p><p> </p><div>02-Feb-2014 12:00 am<span> </span></div><div>01-Mar-2014 12:00 am<span> </span></div><div>02-Mar-2014 12:00 am<span> </span></div><div>03-Mar-2014 12:00 am<span> </span></div><div>04-Mar-2014 12:00 am<span> </span></div><div>05-Mar-2014 12:00 am<span> </span></div>
micajblock
<p>Why not use the default parameter binding like the attached report?</p>