diff --git a/server/migrations/04-00400-query-history-to-batch.js b/server/migrations/04-00400-query-history-to-batch.js
index <HASH>..<HASH> 100644
--- a/server/migrations/04-00400-query-history-to-batch.js
+++ b/server/migrations/04-00400-query-history-to-batch.js
@@ -86,7 +86,7 @@ async function up(queryInterface, config, appLog, nedb, sequelizeDb) {
           SELECT 
             batch_id, 
             SUM(row_count) AS row_count, 
-            MAX(incomplete) AS incomplete
+            MAX(CONVERT(INT, incomplete)) AS incomplete
           FROM 
             statements
           GROUP BY
make view compatible with MSSQL