473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to work with time in format 'hhh:mm:ss' (more than 24 hours)

Hello,

I need to create a column that will store hours bigger than 24. For
example '25:00:00', '129:23:12', etc).

That column will be used too, for perform calculations between
datetime intervals: 'time'.
In MySQL there is a datatype that perfect fits that necessity.

Does anyone know what is the corresponding datatype in SQL Server?

Thanks a lot!

Sep 18 '07 #1
4 21935
There is no such data type in SQL Server. In SQL Server 2008 we have
been promised a TIME datatype that ranges from 00:00:00 to 23:59:59
(plus milliseconds), but it does not reach 24:00:00, much less go
beyond it.

I would consider that as a display requirement, and store in some
other form such as seconds, converting as needed for display.

Roy Harvey
Beacon Falls, CT

On Tue, 18 Sep 2007 16:28:44 -0700, "brazil.mg.marcus.vinicius.lima"
<ma*******@gmail.comwrote:
>Hello,

I need to create a column that will store hours bigger than 24. For
example '25:00:00', '129:23:12', etc).

That column will be used too, for perform calculations between
datetime intervals: 'time'.
In MySQL there is a datatype that perfect fits that necessity.

Does anyone know what is the corresponding datatype in SQL Server?

Thanks a lot!
Sep 19 '07 #2
On 18 set, 20:54, "Roy Harvey (MVP)" <roy_har...@snet.netwrote:
There is no such data type in SQL Server. In SQL Server 2008 we have
been promised a TIME datatype that ranges from 00:00:00 to 23:59:59
(plus milliseconds), but it does not reach 24:00:00, much less go
beyond it.

I would consider that as a display requirement, and store in some
other form such as seconds, converting as needed for display.

Roy Harvey
Beacon Falls, CT

On Tue, 18 Sep 2007 16:28:44 -0700, "brazil.mg.marcus.vinicius.lima"

<marcvl...@gmail.comwrote:
Hello,
I need to create a column that will store hours bigger than 24. For
example '25:00:00', '129:23:12', etc).
That column will be used too, for perform calculations between
datetime intervals: 'time'.
In MySQL there is a datatype that perfect fits that necessity.
Does anyone know what is the corresponding datatype in SQL Server?
Thanks a lot!- Ocultar texto entre aspas -

- Mostrar texto entre aspas -

Sep 19 '07 #3
On 18 set, 20:54, "Roy Harvey (MVP)" <roy_har...@snet.netwrote:
There is no such data type in SQL Server. In SQL Server 2008 we have
been promised a TIME datatype that ranges from 00:00:00 to 23:59:59
(plus milliseconds), but it does not reach 24:00:00, much less go
beyond it.

I would consider that as a display requirement, and store in some
other form such as seconds, converting as needed for display.

Roy Harvey
Beacon Falls, CT

On Tue, 18 Sep 2007 16:28:44 -0700, "brazil.mg.marcus.vinicius.lima"

<marcvl...@gmail.comwrote:
Hello,
I need to create a column that will store hours bigger than 24. For
example '25:00:00', '129:23:12', etc).
That column will be used too, for perform calculations between
datetime intervals: 'time'.
In MySQL there is a datatype that perfect fits that necessity.
Does anyone know what is the corresponding datatype in SQL Server?
Thanks a lot!- Ocultar texto entre aspas -

- Mostrar texto entre aspas -
Thanks for your comment.

When I perform a datetime subtraction (get the diference between two
dates) can i convert the results to seconds?
Thanks a lot!

Sep 19 '07 #4
On Tue, 18 Sep 2007 19:28:20 -0700, "brazil.mg.marcus.vinicius.lima"
<ma*******@gmail.comwrote:
>When I perform a datetime subtraction (get the diference between two
dates) can i convert the results to seconds?
Thanks a lot!
The DATEDIFF function's first parameter specifies if the difference is
calculated in seconds, minutes, hours, weeks, years, etc.

Roy Harvey
Beacon Falls, CT
Sep 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harry J. | last post by:
Hello All; We are trying to build a table for tracking times on the Physical Fitness test. Part of the test is the time it takes to swim so many laps or to run a mile distance. Access has...
2
by: D. Shane Fowlkes | last post by:
Here's a good one. I've been using an Excel spreadsheet for the past couple of years to calculate a file's Estimated Download Time based off of a solid 50kbs connection (dial up). This is for a...
6
by: Able | last post by:
Dear friends I need to format seconds as hh:mm:ss. I see a lot of coding transforming seconds to hh:mm:ss. Somebody know a short way? Regards Able
4
by: Rich | last post by:
Now.ToShortTimeString returns 9:13 PM. I would like to get this in miliatry time with seconds included 21:13:45 (or something like that - just military time with seconds). How can this be...
14
by: Michael Barrido | last post by:
I have this for example: Dim iSeconds as int32 = 3600 '3600 seconds is one hour How do i convert it to "01:00:00" ? Please help. Thanks in advance!
1
by: Jason Chan | last post by:
DateTime mydate = new DateTime(2006,1,1,0,0,0); string testStr = mydate.ToString("hh:mm:ss"); //return 12:00:00 mydate = new DateTime(2006,1,1,1,0,0) testStr = mydate.ToString("hh:mm:ss");...
5
by: kpp9c | last post by:
Hi, I was looking at python & datetime and hoping that it would already have a method/func to translate time formats. I need to translate seconds to hh:mm:ss.ms and vice versa and would like...
5
by: lofty | last post by:
Hi, I'm building a time report system for work and I want to show the total hours and minutes a project have taken but can't get it to work ... I have a database (MySQL) in one table I have...
4
yarbrough40
by: yarbrough40 | last post by:
Can anyone help me to display a Decimal (or double) to elapsed time :mm:ss (hours:minutes:seconds)using vb.net? example: if you were to type "1.34666666666667" into a cell in Excel then choose...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.