• I have frequent need to use BETWEEN type logic for date ranges, where the start date or the end date (or both) may be null.

    If just the start date is null, I want anything earlier than the end date.

    If just the end date is null, I want anything later than the start date.

    If both are null, I want all records.

    I can do this with a user defined function - but want to know if there is a particularly efficient way to approach it. Performance is an issue.