How to convert a String to a Date Value? [message #1692284] |
Tue, 14 April 2015 18:14 |
Ken Strickland Messages: 14 Registered: April 2015 |
Junior Member |
|
|
Here is my input data:
2015/103 2015 103 <=== EXTRACT_DATE EXTRACT_YEAR EXTRACT_DAY (All are string variables)
MCAPP02
MCAPP02
SGPRSML
DAS.BA7.GENNED.CBD.CNTL
0030 0180
55 55
2000/144 0000/000 2013/218 <======= DATES I WILL WANT TO COMPARE AGAINST; CREATE_DATE, EXPIRE_DATE, LASTUSE_DATE
DATA: EXTRACT_YEAR
Expression:
BirtStr.left(dataSetRow["DC_D::DCUDATE"],4)
Returns: 2015
DATA: EXTRACT_DAY
Expression:
BirtStr.right(dataSetRow["DC_D::DCUDATE"],3)
Returns: 103
Can I format the dates in an expression?
Is there a SimpleDateFormat for a yyyy/ddd value?
df = new Packages.java.text.SimpleDateFormat("yyyy-MM-dd");
myDate = df.parse(row["your_date_field_name"]);
myDate;
[Updated on: Wed, 15 April 2015 17:38] Report message to a moderator
|
|
|
|
|
|
Re: How to convert a String to a Date Value? [message #1694661 is a reply to message #1693345] |
Thu, 07 May 2015 01:51 |
|
Could you attach the design? It might be because of the string date. You might look at the x-axis type to make sure it's not an integer. Also, it looks like your B column is a string, so be sure you're not using that one in the y-axis.
Michael
Developer Evangelist, Silanis
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds