cancel
Showing results for 
Search instead for 
Did you mean: 

I need date mapping Below based on condition?

Former Member
0 Kudos

Source sidefield:ZALDAT

Taget Structure mapping condition:

Format MMDDYY. If check is voided then it should be '000000'

Taget field:Issue date

I Need how to mapping source to target field based on conditioin explain me?give me saple mapping given condition?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member187339
Active Contributor
0 Kudos

Hi,

Try this udf

youir input for this udf is "date" (which is a string)



SimpleDateFormat sdf = new SimpleDateFormat("MMddyy");
Date testDate = null;
try
    {
      testDate = sdf.parse(date);
    }

catch (ParseException e)
    {
     return '000000';
    }

    
if (!sdf.format(testDate).equals(date))
  {
    return '000000';
  }
   
return testDate.toString();

code taken and modified from http://www.dreamincode.net/forums/showtopic14886.htm

Regards

suraj

Edited by: S.R.Suraj on Sep 29, 2009 7:53 AM

Former Member
0 Kudos

Hi

Use an UDF and check for the date format from the source, if it is not matching then do the mapping as per your need.

Regards,

Nithiyanandam

former_member181962
Active Contributor
0 Kudos

Hi Sreenu,

Did you try using the DateTrans function of the Date function?

In that, chose the date format as MMDDYY and map to the target.

Regards,

Ravi