diff --git a/rslib/src/storage/notetype/existing_cards.sql b/rslib/src/storage/notetype/existing_cards.sql index 110c80f8b..5f4658e05 100644 --- a/rslib/src/storage/notetype/existing_cards.sql +++ b/rslib/src/storage/notetype/existing_cards.sql @@ -17,8 +17,8 @@ select when 0 then ( case odue - when 0 then due - else odue + when 0 then max(0, due) + else max(odue, 0) end ) else null