3
I’m trying to make the following sql in Firebird.
select distinct tb_proostarefas.*,
(case
WHEN (tb_proostarefas.dt_prev is null and tb_proostarefas.dt_vencimento < date) then 1
When (tb_proostarefas.dt_prev is not null and tb_proostarefas.dt_prev < date) then 2
When (tb_proostarefas.dt_prev is not null and tb_proostarefas.dt_prev >= date) then 3
else 3 end) AS 'STATUS'
from tb_proostarefas
order by tb_proostarefas.gut desc, tb_proostarefas.dt_vencimento
I have the following error:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 3, column 83.
).
How can I solve?
He is not recognizing this "date". What do you want to use there? Is it the current date? "Token Unknown - line 3, column 83."
– Leonardo Machado Moscardo
Completing what the friend above said, if Voce wants it to return to the current date put the current_date command
– GabrielLocalhost