Is it possible to add a value to a count from another count, if so how?
I want to add the value from count(case when NF = '1' then 1 else null end) as NF to count(id) AS [entries]
Dim MyDataAdapter As New SqlDataAdapter("SELECT Klass, " &
"count(case when Grupp = 'A' then 1 else null end) as A, " &
"count(case when Grupp = 'B' then 1 else null end) as B, " &
"count(case when Grupp = 'C' then 1 else null end) as C, " &
"count(DISTINCT Tävlingens_namn) AS [races], " &
"count(id) AS [entries], " &
"count(case when NF = '1' then 1 else null end) as NF, " &
"count(Sluttid) AS [finished], " &
"count(DISTINCT Arrangör) AS [arr], " &
"count(FIDnr) AS [totfid] " &
"FROM resultat " &
"Where Stil = @Stil " &
"AND Datum BETWEEN @startdate AND @enddate " &
"GROUP BY Klass Order By Klass", MyConnection)