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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:38:04+00:00 2026-05-23T16:38:04+00:00

my data in table is like this ds_start_time -> 09:00:00 , ds_end_time-> 09:30:00 ds_start_time

  • 0

my data in table is like this

ds_start_time -> 09:00:00 , ds_end_time-> 09:30:00
ds_start_time -> 09:00:00 , ds_end_time-> 10:30:00
ds_start_time -> 10:00:00 , ds_end_time-> 10:30:00
ds_start_time -> 09:30:00 , ds_end_time-> 10:30:00

i want the difference of date and sum that difference
for that i put this in query

SELECT SUM(TIMEDIFF(ds_end_time,ds_start_time)) 
FROM www
WHERE abc='123'........ 

but at the end i am getting 2058800.000000 . From this how can i get total hrs mins and sec.
Or any other method .Plz suggest.

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

    It’s easy to do this in MySQL if you know how:

    SELECT SEC_TO_TIME(SUM
        (TIME_TO_SEC(ds_end_time) - TIME_TO_SEC(ds_start_time))
                     ) AS timediff     
     FROM www 
     WHERE abc = '123'
    

    Note that if there are many rows that have abc = '123' then you will probably get double counts, in that cause you migth want to try:

    SELECT SEC_TO_TIME(
        (MAX(TIME_TO_SEC(ds_end_time)) - MIN(TIME_TO_SEC(ds_start_time)))
                     ) AS timediff     
     FROM www 
     WHERE abc = '123'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a bit confused on this. I have a data table structured like this:
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
I have a table like this... CustomerID DBColumnName Data 1 FirstName Joe 1 MiddleName
I have a query like this: SELECT TABLE_NAME, COLUMN_NAME, IS_NULLABLE, DATA_TYPE FROM MY_DB.INFORMATION_SCHEMA.COLUMNS WHERE
My html is like this <div id=rsContainer> <table id=rsTable><!-- DATA HERE --></table> </div> and
I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ...
I have a SP with 20 select queries. Each query is table-name-aliased like below.
I have several sources of tables with personal data, like this: SOURCE 1 ID,
I have three tables: page, attachment, page-attachment I have data like this: page ID
if i define a table like this: Dim datatable As PdfPTable = New PdfPTable(4)

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.