I am new to sqlserver, I have recently downloaded and connected to sqlserver 2008 . I am trying to run these two queries from vb.net which works in ms access and vb.net
incorrect syntax near t1
update ch t1 LEFT JOIN table30 T2 on t1.acc = t2.acc SET t1.amount = t2.result
Incorrect syntax near the keyword 'AND'.
select * into Table30 from (SELECT 'Table1' AS [Table], SUM(a) - SUM(b) AS Result FROM table1 where date_ BETWEEN " & FromDate & " AND " & ToDate & " UNION ALL SELECT 'Table2', SUM(a) - SUM(b) FROM table2 where date_ BETWEEN " & FromDate & " AND " & ToDate & ")a
thanks