Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    16

    Question Unanswered: How to check the interval time on records > 2 min.

    How to check the interval time on records > 2 min.

    DateTimeField
    ------------------------
    2003-12-20 08:07:48.427
    2003-12-20 08:08:06.257
    2003-12-20 08:08:24.070
    2003-12-20 08:08:42.693
    2003-12-20 08:08:58.583
    2003-12-20 08:15:16.117 <-- (interval > 2 min.)
    2003-12-20 08:15:33.083
    2003-12-20 08:16:49.617
    2003-12-20 08:17:10.083
    2003-12-20 08:17:33.617

    The query must return like that
    MinHrs MaxHrs
    -------------------------------------------------------
    2003-12-20 08:07:48.427 2003-12-20 08:08:58.583
    2003-12-20 08:15:16.117 2003-12-20 08:17:33.617

    SELECT min(BCCTransaction_Date) as MinHrs , Max(BCCTransaction_Date) as MaxHrs
    FROM SwapPricePlan
    ???

    Thanks and sory about my English

  2. #2
    Join Date
    Sep 2003
    Location
    Dallas, Texas
    Posts
    311

    Re: How to check the interval time on records > 2 min.

    Something like this,

    SELECT min(BCCTransaction_Date) as MinHrs ,
    (select Min(BCCTransaction_Date) FROM SwapPricePlan where datediff(mi, (SELECT min(BCCTransaction_Date) FROM SwapPricePlan), BCCTransaction_Date) > 2)
    as MaxHrs
    FROM SwapPricePlan

Posting Permissions

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