Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Circular reference caused by alias 'ValueItem' in query definition's SELECT list., SQL state S1000 in SQLExecDirect in C:\AppServ\www\phpweb\oee2.php on line 22
Error Execute [Select Sum(ValueItem) as ValueItem From oee Where item like 'tr%']
$objConnect = odbc_connect("oee","","") or die("Error Connect to Database");
$sumtr="Select Sum(ValueItem) as ValueItem From oee Where item like 'tr%'";
$objExec = odbc_exec($objConnect, $sumtr) or die ("Error Execute [".$sumtr."]");
$Num_Rows = 0;
while(odbc_fetch_row($objExec))$Num_Rows++; // Count Record
$objConnect = odbc_connect("oee","","") or die("Error Connect to Database");//SELECT SUM(Column/Field) AS [New-Field] FROM [Table-Name]
$sumtr ="Select Sum(Valuetime) as ValueItem From oee Where item like 'tr%' ";
$objExec = odbc_exec($objConnect, $sumtr) or die ("Error Execute [".$sumtr."]");
$Num_Rows = 0;
while(odbc_fetch_row($objExec))$Num_Rows++; // Count Record "SELECT SUM(valuetime) AS [sumvalue] FROM [oee] "
?>