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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:00:20+00:00 2026-06-03T21:00:20+00:00

So far I have managed to write a query to list all the outgoing

  • 0

So far I have managed to write a query to list all the outgoing calls made by a user and their duration, but what I’m looking for is, rather than a list of all the individual calls, a total of the duration.

SELECT starttime, duration, is_answ, is_fromoutside, from_no
  FROM callhistory3
 WHERE is_answ = 't'
   AND is_fromoutside = 'f'
   AND starttime >= CURRENT_DATE
   AND from_no = '101';

The duration is in the format 00:00:00:00.000 (Days:Hours:Minutes:Seconds.Hundredths), so my question is really how do I add this up and present it as a single number for duration, rather than a list of individual calls each with their own separate duration?

My final query is as follows to anyone that is interested:

SELECT from_no, SUM(duration), COUNT (*)
  FROM callhistory3
 WHERE is_answ = 't'
   AND is_fromoutside = 'f'
   AND starttime >= CURRENT_DATE
 GROUP BY from_no
 ORDER BY from_no;
  • 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-03T21:00:21+00:00Added an answer on June 3, 2026 at 9:00 pm

    If the duration really always has exactly that format:

    SELECT from_no, sum(duration)
      FROM callhistory3
      WHERE is_answ = 't'
        AND is_fromoutside = 'f'
        AND starttime >= CURRENT_DATE
        AND from_no = '101'
      GROUP BY from_no
      ORDER BY from_no;
    

    Well, if you really are just doing it for one from_no you could simplify it by just selecting the sum() and leaving off the GROUP BY and ORDER BY clauses, but it seems likely you might want a list; for that, you can just change the WHERE clause above.

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

Sidebar

Related Questions

So far I have managed to write some code that should print the source
So far I have managed to get the background image to stretch: XHTML: <div
So far i have managed to display the contents of a row(4 columns) in
So far I have been creating Web Portal but recently I had a request
I'm attempting to write a C# managed class to wrap SHGetKnownFolderPath, so far it
I have to write a tool, that uses the IIS7 Managed Code Administration API.
So far I have learned about generating thread dump and heap dump using jstack
So far i have this: mov ah,02h mov cl,11001100001111011101000b ;6,692,584 in dec mov dl,0
So far i have an assembly script that lets you boot from it and
What I have so far: I have a form in PHP that contain the

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.