on 06-15-2007 2:53 PM
Hi all,
I want to convert a date (e.g. 2007-06-15) in format 20070615. I used the DateTrans - Function (yyyy-MM-dd to yyyyMMdd). Normally it works fine. But if the incoming date is 0000-00-00 the result is 00021130. Whats wrong, how to get the correct date (00000000)?
Is there an adjustment in XI, that the internal format (incoming e.g. from a rfc-adapter) is in format YYYYMMDD and not YYYY-MM-DD.
Mathias,
Do you think 0000-00-00 is the correct date format? If you really get the input like this ,then I suggest you to compare the inpu with constant 0000-00-00 , if both are equals then map constant 00000000 to the output else use DateTrans and map to the output.
What do you say?
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think Raj has given the perfect solution. Just use mapping comapre the date if it is coming 0000-00-00 then pass 00000000 else actual date. write a user defined function.
Regards
Hemant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ebel,
Use an if condition. If the date is equal to 0000-00-00 then you pass 00000000 else you use the conversion what you have specified. This should work because if you dont have date then I think you are sending this, if you have date assuming it is coming in the correct format.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mathias,
Take the date , month, year value to a constant and use an if else condtion to proceed further. Only if the value is greater than 0 you will proceed further with mapping.
thanks
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mathias,
This is not so much a problem in XI but rather the way Java behaves.
One way to tackle this problem might be to use the 'replaceString' function (under 'Text'), replacing - with an empty constant.
Kind regards,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.