How to generate a select
that brings the date between an informed date and the date of the next record?
In the Cargos
table I only have a date, not a data_inicio
and a data_fim
, and I need to know the date between the entered date and the next record date.
For example, if I enter the date 01/10/2015
:
From:
|NOME |CARGO |DATA_CARGO |
|FULANO |AUXILIAR ADMINISTRATIVO |29/05/2006 00:00:00|
|FULANO |SUPERVISOR |01/07/2013 00:00:00|
|FULANO |SUPERVISOR FINANCEIRO |01/09/2015 00:00:00|
|FULANO |ADMINISTRADOR GERAL |01/02/2016 00:00:00|
I would just like to report:
|NOME |CARGO |DATA_CARGO |
|FULANO |SUPERVISOR FINANCEIRO |01/09/2015 00:00:00|
If I put the code where data >= data_informada
as you can see, it does not have the desired record.
ps: The database is Firebird.