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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:57:50+00:00 2026-06-04T01:57:50+00:00

I am trying to run the following query : SELECT A.STEPNAME, A.BRDATE BRDATE_A, B.BRDATE

  • 0

I am trying to run the following query :

SELECT  
  A.STEPNAME, 
  A.BRDATE BRDATE_A, 
  B.BRDATE BRDATE_B, 
  MIN(A.STARTTIME) STARTTIME_A, 
  MAX(A.ENDTIME) ENDTIME_A, 
  MIN(B.STARTTIME) STARTTIME_B, 
  MAX(B.ENDTIME) ENDTIME_B, 
  'RUNTIME_A' = convert(VARCHAR,DATEDIFF(MINUTE,A.STARTTIME,A.ENDTIME),108) ,
  'RUNTIME_B' = convert(VARCHAR,DATEDIFF(MINUTE,B.STARTTIME,B.ENDTIME),108) 
FROM 
  CB_OPX_AUDIT_HIST A, 
  CB_OPX_AUDIT_HIST B
WHERE  
  A.BRDATE = ('05/11/2012') 
AND 
  B.BRDATE = ('05/16/2012') 
AND 
  A.BR = '03'
AND 
  A.STEPNAME=B.STEPNAME
AND 
  A.BR=B.BR
GROUP BY 
  A.STEPNAME, 
  A.ENDTIME, 
  A.STARTTIME,
  A.BRDATE,
  B.BRDATE,
  B.ENDTIME, 
  B.STARTTIME
ORDER BY  
  A.STARTTIME

I need the difference between ‘RUNTIME_A’ AND ‘RUNTIME_B’ ..

Can someone tell me how do i get the difference in the above query.?

  • 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-04T01:57:51+00:00Added an answer on June 4, 2026 at 1:57 am

    For simplicity, I would suggest just changing from using VARCHAR to using DATETIME and run a simple datediff again

    DATEDIFF(MINUTE, 
        convert(DATETIME,DATEDIFF(MINUTE,A.STARTTIME,A.ENDTIME),108), 
        convert(DATETIME,DATEDIFF(MINUTE,B.STARTTIME,B.ENDTIME),108)
    )
    

    You can wrap your original query as a subquery to simplify things.

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

Sidebar

Related Questions

I'm trying to run the following query: SELECT formatted_journeys.*, MAX(speed) FROM formatted_journeys JOIN tracker.g_log
I have been trying to run the following query in SPARQL explorer SELECT DISTINCT
I'm trying to run a select query, which is the following: SELECT * FROM
I'm trying to run the following MySQL query: SELECT * FROM user u JOIN
I'm trying to run the following MS SQL query: select PolicyCode, OccupancyCode, premiumcode, VersionNumber,
I'm trying to run the following query in SQLite 3: SELECT *, DISTANCE(latitude, longitude,
I'm trying to run the following MySQL query: mysql> SELECT num.value, agro.mean, agro.dev ->
I am trying to run the following script (unsuccessfully): $variables = $db->query(SELECT * FROM
I'm trying to run the following query, and I'm having trouble with the wildcard.
I'm trying to run the following query from phpMyAdmin (on a local WAMP server):

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.