I have the following excerpt from a CASE in my SQL
SELECT CASE WHEN (tabela01.data_abertura - INTERVAL tabela02.garantia 'month') <= tabela01.data_nf
THEN 'Dentro do Prazo'
ELSE 'Fora do Prazo'
END AS medicao_garantia
... Where:
- date_abertura: Start date of a service
- data_nf: Product invoice date
- Warranty: Number of months the product is under warranty
I have to compute INTERVAL
, but I'm missing the syntax.
I've tried:
INTERVAL(tbl_produto.garantia 'month')
INTERVAL 'tbl_produto.garantia month'
INTERVAL tbl_produto.garantia 'month'
But with no satisfactory results.