You can use the between it specifies a range to be tested.
Syntax:
test_expression [ NOT ] BETWEEN begin_expression AND end_expression
Arguments?
test_expression
Is the expression to be tested in the range defined by
begin_expressione end_expression. test_expression must have the same
data type that begin_expression and end_expression.
NOT
Specifies that the predicate result must be denied.
begin_expression
Is any valid expression. begin_expression must have the same type of
data that test_expression and end_expression.
end_expression
Is any valid expression. end_expression must have the same type of
data that test_expressione begin_expression.
AND
Acts as a placeholder indicating that test_expression must
be within the range specified by begin_expression and
end_expression.
In short.
Select * from sua tabela
where suadata BETWEEN DT_INICIO and DT_FIM
Data > DT_INICIO AND Data < DT_FIM
? You can use it tooBETWEEN
– DH.
You can use
...where data between data_inicio and data_fim
or...where data >= data_inicio and data <= data_fim
, plain as that.– Ivan Ferrer