I am trying to update an sql column to show the percentage by dividing a column of real type (Amount) by a variable of double type (Total) which is calculated earlier and has a value, however I am confused how to write the statement.
Below code gives an error saying no column with name Total exists which is a value not a column!
Thanks in advance.
SqlCommand percent = new SqlCommand("UPDATE QuantitiesTable SET percgrosvol = (Amount/Total)", ccn);
percent.ExecuteScalar();