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)
Format date from integer
gslane
I have a date value coming from my dataset that is in an integer format, ie, 20090126. I need to convert it to a m/d/yy format. what is the best way to do this?
Find more posts tagged with
Comments
mwilliams
Hi gslane,<br />
<br />
There may be several ways to go about that. One way would be to use substrings and concatenate a string out of that to look like a date. Then you can convert the date string type to a date type with this <a class='bbc_url' href='
http://www.birt-exchange.com/devshare/designing-birt-reports/203-convert-string-date-to-date-object-in-birt/#description'>tip</a>
; from the devShare.<br />
<br />
Hope this helps.
gslane
thanks michael..... I understand the devshare tip, but I'm having difficulty finding the code that will convert the integer value to a string so I can manipulate it with substring. when I try to substring the integer value directly I don't get any value displayed on the report in that column.
mwilliams
gslane,
row["integerFieldName"].toString() should do it.
gslane
perfect..... that worked.
thanks for your help.
mwilliams
No problem. Let us know if you have any other questions.