SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2002
    Location
    Rochester, NY
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    selecting overlapping datetime ranges

    Hi folks,

    I'm trying to select overlapping datetime ranges in a database. Basically, given two timestamps, I'd like to select all entries in the database that the datetime range overlaps (not just falls between).

    Is there a simple way to do this, or do I have to do some nightmarishly long query?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    yes, there is an easy way

    perhaps this might help -- http://www.sitepoint.com/forums/showthread.php?t=228183

    if not, post your column names and we'll see
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2002
    Location
    Rochester, NY
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Worked great, thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •