Select query returns result beyond the range specified...?

  • Hi Members,

    Im doing a select in which im specifying the date range..

    "select key_id from result where started_at_date >= '2008-10-17 13:30:00' and ended_at_date <= '2008-10-17 13:30:20'"

    but in the above query im getting the key_id for which the date range is out of the date range specified here.

    That is im getting key_id = 5, for whcih started_at = '2008-10-18 13:30:00' and ended_at = '2008-10-18 13:30:20'

    Please help me to solve this issue.

    Regards,

    Prabhu.

  • please see the link below to help us figure out what's going on. Sample DDL and data will help us to solve your issues faster.

    Thanks,

    Jon

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

Viewing 2 posts - 1 through 1 (of 1 total)

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