I have a Stored Procedure
where I need to do a check for a date filter, if the start date is null I have to do in WHERE
to get all records smaller than the end date, otherwise I make BETWEEN
between dates.
Example
If the start date is null then:
select * from tabela where campoTabela <= @datafim
Otherwise:
select * from tabela where data between @dataInicial and @datafim