Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


formatting result of sum function on time field from mysql into ASP webpage

Posted on 2005-04-27
Medium Priority
Last Modified: 2008-03-06

got a table which has a time field hhhh:mm:ss (dont ask why hhhh as i dont care and it does not make a difference)
doing a mysql statement as this

SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(totaltime))) as ttotal from scostudentscores where(rolcourseid='BCLIB')
this basically totals up the time where a field has a certain value... GREAT and i get the correct result of 00:04:00


when i response.write the field into ASP web page i get the current date..... eg 27/04/2005

have tried doing a hour(variable), minute(variable) etc and it gives nme 0:0:0
the session.lcid is for UK which is 2057...  the server the website is running on has the correct timezone... so i need assistance...

thanks in advance


Question by:Cybordax
1 Comment
LVL 29

Accepted Solution

rdivilbiss earned 2000 total points
ID: 13875744
Dim strTime, mTime
strTime = "00:40:00"

mTime = TimeValue(strTime)

response.write mTime

Returns a proper time from the string you have.

It is going to be in the format 12:40:00 AM

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question