peter piper

peter piper

  • NA
  • 22
  • 3.8k

get value from Sql Statement and store in a variable

Aug 1 2015 11:51 AM
This is the Sql statement I am using behind a button in c# which
will populate a DataGridView 
 
SqlDataAdapter = new SqlDataAdapter(@"SELECT detail.branch,
SUM(CONVERT(DECIMAL(8, 2), detail.total)) AS TOTAL,
SUM(CONVERT(DECIMAL(8, 2), detail.typeA)) AS SALES
FROM detail
 
I need to extract and store the value of TOTAL so I can use it in another
Sql Statement. Is this possible ?
 

Answers (3)