Jump to content

Asp.net / Sql Beginners Q


svl_kent

Recommended Posts

Hello!This is probably on a very low level for must of you but I have just starting to look at ASP.NET after working with ASP for many years.I have difficulties to understand how handling data from databases works in .NET.Example - in ASP I have the following SELECT code:sqlATN = "SELECT new_vendor, Sum(new_revenueGP) AS SumRevenueGP WHERE MONTH(new_date) = '" & (Month(now())-1) & "' AND YEAR(new_date) = '" & year(now()) & "' AND new_vendor = 'ATN' AND DeletionStateCode <> 2 GROUP BY new_vendor ORDER BY new_vendor ;" set rsATN = server.createobject("adodb.recordset") rsATN.Open sqlATN, conn11, 3, 3 sqlATA = "SELECT new_vendor, Sum(new_revenueGP) AS SumRevenueGP WHERE MONTH(new_date) = '" & (Month(now())-1) & "' AND YEAR(new_date) = '" & year(now()) & "' AND new_vendor = 'ATA' AND DeletionStateCode <> 2 GROUP BY new_vendor ORDER BY new_vendor ;" set rsATA = server.createobject("adodb.recordset") rsATA.Open sqlATA, conn11, 3, 3 Then I can use the different result and show the result or calculate with them, for example:RESULT = (rsATN.fields("SumRevenue") + rsATA.fields("SumRevenue"))and<td class="Text" align="right"><% = Formatcurrency((RESULT),0) %></td>Is it possible to do in .NET? Of Course :) - BUT HOW??/TIA / Kent

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...