#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); #### $sqlInsert = "Insert into tblMaster (List_Name_, Gender_, First_Name_, Last_Name_, Full_Name_, Address_1_, City_, State_, Zip_Code_, SCF_Code_, Country_, Email_, Domain_Name_, TLD_, DOB_) Values ('$ListName','$Gender','$FirstName','$LastName','$FullName','$Address','$City','$State','$Postal','$SCF','$Country', '$Email','$DomainName','$TLD', cast('$ODBCDate' as datetime))";