Fix type mismatch in UnusedDays binding

NULLIF(int, '') fails when prepared statements type the parameter
as integer. Use direct cast since NUMBER input always has a value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 16:18:58 -05:00
parent 815023dca9
commit ac475d683f
2 changed files with 2 additions and 2 deletions

View File

@@ -31,5 +31,5 @@ LEFT JOIN (
GROUP BY isite.itemsite_item_id
) last_txn ON last_txn.itemsite_item_id = i.item_id
WHERE (CURRENT_DATE - COALESCE(last_txn.last_transaction_date, i.item_created, cc.comment_date)::date)
>= COALESCE(NULLIF('{{UnusedDays.text}}','')::int, 365)
>= '{{UnusedDays.text}}'::int
ORDER BY "Days Unused" DESC