Comparing Dates

  • Yea, gotcha on the range check. The problem is every time I do something like that, the optimizer stops using my index on that column which brings things to a crawl.

    .

  • I guess stripping the time is the best bet. I'll stick with that. If I strip the time off the parms first rather than the doing it in the WHERE, the optimizer should be ok with that I think.

    Thanks Jeffery.

    .

  • BSavoie (1/8/2010)


    I guess stripping the time is the best bet. I'll stick with that. If I strip the time off the parms first rather than the doing it in the WHERE, the optimizer should be ok with that I think.

    Thanks Jeffery.

    As long as you are not using a function on a column - and only using the functions on parameters, the optimizer can use an index if it exists. It still may not choose to use that index - if a better index exists or the range is so large a scan makes more sense.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 3 posts - 16 through 17 (of 17 total)

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