SELECT xls_sales_data .*, average_rate.ar_id AS ar_id, average_rate.ar_average AS ar_average, average_rate.ar_active AS ar_active
FROM xls_sales_data JOIN average_rate ON average_rate.ar_id = xls_sales_data.AR_ID
WHERE ar_active='1' AND MONTH=9 AND YEAR=2012
$objQuery_ar = mysql_query($strSQL_ar) or die ("Error Query [".$strSQL_ar."]");
$objResult_ar = mysql_fetch_array($objQuery_ar);