Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:50:57+00:00 2026-06-18T11:50:57+00:00

A process runs (is supposed to run) every 15 mins and add and entry

  • 0

A process runs (is supposed to run) every 15 mins and add and entry to a MS SQL 2012 logging table.

2013-02-07 10:07:47.000
2013-02-07 09:52:36.000
2013-02-07 09:37:34.000
2013-02-07 09:22:32.000
2013-02-07 09:07:31.000
2013-02-07 08:52:29.000
2013-02-07 08:37:28.000
2013-02-07 08:13:53.000
2013-02-07 07:58:51.000
2013-02-07 07:43:50.000
2013-02-07 07:28:48.000
2013-02-07 07:13:47.000
2013-02-07 06:58:37.000

I need help with a query that will return consecutive timestamps that are > 16 minutes apart. In the above records, the query would return 2013-02-07 08:37:28.000 and 2013-02-07 08:13:53.000

EDIT – Add reference to MS SQL

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:50:58+00:00Added an answer on June 18, 2026 at 11:50 am

    The answer to this question very much depends one which RDBMS you are using.

    Something like this should work for SQL Server using DATEDIFF and ROW_NUMBER:

    WITH CTE AS (
      SELECT ProcessTime, ROW_NUMBER() OVER (ORDER BY ProcessTime DESC) RN
      FROM Process
      )
    SELECT P.ProcessTime, 
      P2.ProcessTime as ProcessTime2, 
      DATEDIFF(mi,  P.ProcessTime, P2.ProcessTime)
    FROM CTE P
      JOIN CTE P2 ON P.RN = P2.RN + 1
    WHERE DATEDIFF(mi, P.ProcessTime, P2.ProcessTime) > 16
    

    It’s putting the dates in 2 separate columns — easy enough to put in a single column if preferred.

    Here is the Fiddle.

    If you let us know the RDBMS, we could put together an alternative solution if needed.

    For Oracle, use extract( minute from P2.ProcessTime - P.ProcessTime ) vs DATEDIFF – the rest of the query should work — here is the Fiddle.

    For MySQL, the code would be a little different as MySQL doesn’t support CTEs or ROW_NUMBER. But this should get you in the right direction.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a feed process which runs every day of the year. As part
I need to have a background process that runs independent of my app and
In my Perl/CGI web application, I sometimes need to run a long process which
I'm running mod_python under Apache. If I've understood correctly, each Apache process runs its
I have a Windows process that runs in the background and periodically backs up
I have a process that currently runs in a Delphi application that I wrote
So a OS multi-tasks and runs one process at a given moment (assuming it's
I would like seek some guidance in writing a process profiler which runs in
There is any command line or .NET method that runs a process in the
tail -f test.log Above command will tail the log which runs the process behind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.