Pulling incorrect records using date range in where clause

  • I've come across somewhere that using BETWEEN is slower that actually using the less than/greater than operator. I have not done any testing on it. Any quick feedback on this?

    ----------------------------------------------------

  • The tests that I've made, show that the advantage is minimal and not worth it. However, the flexibility you gain when not using BETWEEN is a good reason to avoid it.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • If you look at the execution plan of a query using the BETWEEN operator you will see that it is converted to a >= and <=.

  • If you look at the execution plan of a query using the BETWEEN operator you will see that it is converted to a >= and <=.

    Good Point, thanks.

    ----------------------------------------------------

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply