• Nice article, well written. As a developer that has had to do a lot of work around date and time functionality, I can appreciate this article. You are correct that this is really the most efficient way to get active rows based on start/end dates. It would be really great if you could do an advanced version and show people how to deal with reverse dates (for databases that don't have proper constraints and allow end dates to be incorrectly added with values prior to the start date - you know we don't always have control over every database design) and more importantly, NULL values. Assuming that in some cases, depending on the business rules and purpose of the data, an end date hasn't been determined yet and may be NULL. I prefer to use a COALESCE for this, forcing the NULL end dates to be the day following the variable end date of the range to be tested. But there are a number of other ways to do this.

    Jerry Boutot, MCAD MCP, MTA
    Jerry Boutot Official