Fixed calculation in part changes
This commit is contained in:
parent
0de14ec886
commit
8b1cf80ded
@ -34,10 +34,16 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
|
||||
|
||||
SqlCommand cmd = _connection.CreateCommand();
|
||||
|
||||
string query = "SELECT COUNT(*) FROM " +
|
||||
"(SELECT REACTOR, COUNT(PROD_SPEC_ID) - 1 AS PCHANGE FROM " +
|
||||
"(SELECT REACTOR, PROD_SPEC_ID, COUNT(WO) AS PSN_COUNT FROM RDS WHERE DATE_OUT BETWEEN @startDate AND @endDate GROUP BY REACTOR, PROD_SPEC_ID) AS t " +
|
||||
"GROUP BY REACTOR) AS l WHERE PCHANGE > 0";
|
||||
string query = "SELECT SUM(PCHANGE) " +
|
||||
" FROM (SELECT REACTOR, " +
|
||||
" COUNT(PROD_SPEC_ID) - 1 AS PCHANGE " +
|
||||
" FROM (SELECT REACTOR, " +
|
||||
" PROD_SPEC_ID, " +
|
||||
" COUNT(WO) AS PSN_COUNT " +
|
||||
" FROM RDS " +
|
||||
" WHERE DATE_OUT BETWEEN @startDate AND @endDate " +
|
||||
" GROUP BY REACTOR, PROD_SPEC_ID) AS t " +
|
||||
" GROUP BY REACTOR) AS l";
|
||||
|
||||
cmd.CommandText = query;
|
||||
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user