Aha, I just thought about it and the problem may be in another area... Here is the next bit of the code(with $sql_out being the query above)..what it does is take data from several tables in an MSSQL DB and puts it in one table in a MySQL DB. The code worked fine before I changed the query to link a 4th table in the MSSQL query....
$query = mssql_query($sql_out);
//loop to get each row from mssql
$i = 1;
while ($line = mssql_fetch_array($query)) {
//insert current finesse data into mysql
$acc_ref = $line["Acc_Reference"];
$acc_des = $line["Acc_Description"];
$at_des = $line["AT_Description"];
$ab_abf = $line["JI_Amount"];
$ab_bud = $line["AB_Budget"];
$ab_act = $line["AB_Actual"];
$ab_ono = $line["AB_On_Order"];
$sql_in = "INSERT INTO $mytablename (account_id,Acc_Reference,Acc_Description,AT_Description,JI_Amount,AB_Budget,AB_Actual,AB_On_Order) VALUES ('$i','$acc_ref','$acc_des','$at_des','$ab_abf','$ab_bud','$ab_act','$ab_ono')";
mysql_query($sql_in);
$i++;
} //end loop
Thanks for the reply