'********************************************************************** ' Visual Basic Transformation Script ' Copy each source column to the ' destination column '************************************************************************ Function convert_date(date_passed) 'Create a valid year value from the original MANMAN date 'Ensure that there are no trailing blanks to screw us up date_val = trim(cstr (date_passed)) 'Break up the date 'Year stays as a string for further manipulation temp_yr = Left(date_val, 2) 'Month and day values can convert now mo = cint(Mid(date_val, 3, 2)) da = cint(Right(date_val, 2)) 'Fix the year value accordingly If IsNumeric(Left(temp_yr, 1)) Then 'This is a number, must be in 00-99 range yr = 1900 + cint(temp_yr) Else 'It's a letter, must be a funky date yr = 2000 + ((Asc(Left(temp_yr, 1)) - Asc("A")) * 10) + cint (Right(temp_yr, 1)) End If 'Create the new date value convert_date = DateSerial(yr, mo, da) End Function Function Main() DTSDestination("date_datevalue") = convert_date (DTSSource("date_char")) Main = DTSTransformStat_OK End Function