Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010
    Posts
    4

    Question Unanswered: sql query for getting startdate and enddate between dates

    Hi

    i need a sql query which shows the start date and end date between many dates for a incident

    eg:

    datestaamp Incident

    2009-09-29 06:26:00.000 IM1
    2009-10-05 13:12:03.000 IM1
    2009-09-29 12:09:24.000 IM1
    2009-09-29 11:54:18.000 IM1
    2009-09-29 09:17:23.000 IM1
    2009-09-29 09:13:14.000 IM1

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    More detail required!

    Can we have the table design (including data types), sample data and desired output. This will illustrate the question and hopefully help us to help you!
    George
    Home | Blog

  3. #3
    Join Date
    May 2010
    Posts
    4
    i need a sql query which shows the start date and end date between many dates for a incident

    eg:
    datestaamp Incident

    2009-09-29 06:26:00.000 100
    2009-10-05 13:12:03.000 100
    2009-09-29 12:09:24.000 100
    2009-09-29 11:54:18.000 100
    2009-09-29 09:17:23.000 100
    2009-09-29 09:13:14.000 100

    i need a sql query, the incident id is 100 it is raised on 2009-09-29 09:13:14.000 and it is resolved on 2009-10-05 13:12:03.000

    from this sequence of dates i need only the start date and end date ie start date 2009-09-29 09:13:14.000 end date2009-10-05 13:12:03.000

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Just use the Min() and Max() functions.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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