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 906325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:22:12+00:00 2026-05-15T16:22:12+00:00

+——+————————-+ | proc | endTime | +——+————————-+ | A | 2010/01/01 12:10:00.000 | |

  • 0
 
+------+-------------------------+
| proc |                 endTime |
+------+-------------------------+
|    A | 2010/01/01 12:10:00.000 |
|    B | 2010/01/01 12:08:00.000 |
|    C | 2010/01/01 12:05:00.000 |
|    D | 2010/01/01 12:02:00.000 |
|   ...|                     ... |

So basically the data I pull from the database will look something like the above, with the first column being the name of a process, and the second column the time it finished running. I want to add a THIRD column, where it displays the running time of the process.

Basically, I want the data pulled to look like this instead:

 
+------+-------------------------+--------------+
| proc |                 endTime |  runningTime |
+------+-------------------------+--------------+
|    A | 2010/01/01 12:10:00.000 |              | (process a is not done running)
|    B | 2010/01/01 12:08:00.000 | 00:03:00.000 |
|    C | 2010/01/01 12:05:00.000 | 00:03:00.000 |
|    D | 2010/01/01 12:02:00.000 | 00:02:00.000 | (assume 12:00 start time)
|   ...|                     ... |          ... |

And I know it would be easier it add a startTime column and from that determine runningTime, but I don’t have access to change that, and regardless the old data would not have a startTime to work with anyways.

The first process’s start time is arbitrary, but you see what I’m getting at. We know the run time of proc C based on when proc D ended, and the when proc C ended (subtract the first from the second).

How do I compute that third row based on the difference between “Row X Col B” and “Row X-1 Col B”?

  • 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-05-15T16:22:13+00:00Added an answer on May 15, 2026 at 4:22 pm

    I don’t think you can add it as a “calculated column”. You can calculate it in a view pretty easily like this (all code for MSSQL. Your convert function may vary):

    select 
        e1.RowID, 
        e2.EndTime as StartTime, 
        e1.EndTime, runningtime=convert(varchar(20), e1.EndTime - e2.EndTime, 114)
    from endtimetest e1
        left join endtimetest e2 on e2.endtime = 
                (Select max(endtime) 
                  from endtimetest 
                  where endtime < e1.Endtime) 
    

    Or, you could calculate it in a trigger with something similar.

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

Sidebar

Ask A Question

Stats

  • Questions 511k
  • Answers 511k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can implement a customer scheduler by extending the IScheduler… May 16, 2026 at 5:14 pm
  • Editorial Team
    Editorial Team added an answer I'd say the following: In case the email should be… May 16, 2026 at 5:14 pm
  • Editorial Team
    Editorial Team added an answer You should be fine with any host that supports java… May 16, 2026 at 5:14 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

By fixed vector I mean a static list of values, like 1 through 24.
I'm including a local class that requests a file from a remote server. This
My app uses a WebRequest at certain points to get pages from itself. This
I've got a typical impedance mismatch where the data is stored in a normalized
I basically have the classic many to many model. A user, an award, and
I have text I am displaying in SIlverlight that is coming from a CMS
I recently ran against a very interesting site that expresses a very interesting idea
I'm using some of Firefox's specially-defined values for cursor, in particular -moz-zoom-in -moz-zoom-out -moz-grab
This is a follow-up to the question: Should the folders in a solution match
I've an ASCII file that contains an EM Dash (— or &mdash; in HTML).

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.