I need to compare two tables in my sql ce database.
Normally to do this i would union the two tables then select the name field and sum the oty field.
this is my sql statement
if i run this sql statement in the query analyser it works fine, yet if i put it inside my applicaion, its does not work and i get an sql exception.Code:SELECT A, SUM(B) FROM tbl_1 WHERE C = " & myVAL & " GROUP BY A UNION SELECT A, SUM(B) FROM tbl_2 WHERE C = " & myVAL & " GROUP BY A
am i missing something,
if i remove the WHERE Clause it will union the 2 tables fine inside my application





Reply With Quote