Jump to content

Help Please!!


DcVirtual

Recommended Posts

Hello All,

I have a database which stores a total time value for each entrie:

Example Hours, Minutes, Seconds 02:15:33

I want to get the total of every row. I can get the sum but it displays the result as a whole number:

Example: 1236894 instead of 143:46:14

Type data: time
Null: No
Default: 00:00:00

Any help would be great. Thanks in advanced.
Link to comment
Share on other sites

Im not quite sure if i understand what you're asking but anyway, to do any maths on a date or time, you need to convert to a unix time stamp with [a href=\"http://php.inspire.net.nz/manual/en/function.mktime.php\" target=\"_blank\"]mktime()[/a] ]. You can then put it back into a normal format using [a href=\"http://php.inspire.net.nz/manual/en/function.date.php\" target=\"_blank\"]date()[/a]
Link to comment
Share on other sites

[!--quoteo(post=368611:date=Apr 25 2006, 10:41 PM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ Apr 25 2006, 10:41 PM) [snapback]368611[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Im not quite sure if i understand what you're asking but anyway, to do any maths on a date or time, you need to convert to a unix time stamp with [a href=\"http://php.inspire.net.nz/manual/en/function.mktime.php\" target=\"_blank\"]mktime()[/a] ]. You can then put it back into a normal format using [a href=\"http://php.inspire.net.nz/manual/en/function.date.php\" target=\"_blank\"]date()[/a]
[/quote]


The field in question already does this, I think. The data is listed in the format I want:

Field: TotalBlockTime
Data in this field is listed as: 02:15:33

I want to get the total TotalBlockTime of all rows.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.