Well the first thing I see is you have two tables named "Table1" and "Table2".
But in your query string you have "Table1" and "Table".
As long as you only have one entry in your table fields then your query should work fine.
And you don't need the WHILE loop because you are getting only one result.
But if you are trying to use the WHILE loop because you have more than one entry in each table field, then the SUM command will not give you the expected results.
And you will have to SUM each field and do your calculations in your output instead of the query.