#Taking the values one at a time, and assigning to variables $DOBYear = $ayDOB_Year[$i]; $DOBMonth = $ayDOB_Month[$i]; $DOBDay = $ayDOB_Day[$i]; #Concatonating the string $ODBCDate = sprintf("%4d-%02d-%02d", $DOBYear, $DOBMonth, $DOBDay);