hi I want to make a query that first find the sum of two columns of different table then subtract it Example it is a visual basic program Dim large_tbl As String Dim sell_large As String large_tbl = "SELECT Sum(No_Of_Bottle) FROM add_cotton where Cateogry='Large'" sell_large = "SELECT Sum(Quantity) FROM Sell_Detail where Cateogry='Large'" Adodc2.RecordSource = large_tbl - sell_large Please help it shows an error type miss match
Jump to Post
Sorry but you can't just actually subtract (or any arithmetic operation) 2 SQL statements. (or maybe for UNION or JOINS)
What you need to do is modify your 2 SQL then subtract the value of 2 specifice columns on those tables.
Dim sum1, sum2 as String sum1 …
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.