Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

help with sql queries

$
0
0

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



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>