Given: 2 tables (BookA and BookB) connected to each other by UNION ALL and each table with the same columns: OUT and IN
Try to sum the 2 tables in 2 columns OUT and IN (OUT = BookA + BookB / IN = BookA + BookB)
The query below gives the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
Thanks for tips on how to fix this error.
Try to sum the 2 tables in 2 columns OUT and IN (OUT = BookA + BookB / IN = BookA + BookB)
The query below gives the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
Thanks for tips on how to fix this error.
Code:
<%
SQL = "SELECT SUM(S_IN) AS TotIN, SUM(S_OUT) AS TotOUT FROM (SELECT SUM(Out) AS S_OUT, SUM(In) AS S_IN" & _
"FROM BookA" & _
"WHERE membersid =" & session ("uid") & "UNION ALL SELECT SUM(OUT) AS TotOUT, SUM(In) AS TotIN" & _
"FROM BookB" & _
"WHERE membersid =" & session ("uid")