Page 1 of 1

StringToDate() Mixed data single digit and double digits

Posted: Tue Nov 03, 2015 2:48 pm
by MrBlack
Hi

Does anyone know if there's a format mask that can handle mix digit lengths for the format mask of StringToDate() function? Example data:

Code: Select all

1/1/2015
02/02/2015
11/15/2015
My the string dates are consistent and this format mask in a transformer isn't working for me:

Code: Select all

StringToDate(DSLink1.DOB,"%mm/%dd/%yyyy")
And I've also tried:

Code: Select all

StringToDate(DSLink1.DOB,"%m/%dd/%yyyy")
But if change my data to always be 2 digits for month and day, then things work fine. I didn't see any format mask options on the IBM website but maybe I missed something.

Posted: Tue Nov 03, 2015 3:24 pm
by ray.wurlod
You did miss something. In particular, the "s" option.

Read about it at http://www-01.ibm.com/support/knowledge ... rmats.html

Example: %(m,s)/%(d,s)/%yyyy