PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > How to work with time in format 'hhh:mm:ss' (more than 24 hours)
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
How to work with time in format 'hhh:mm:ss' (more than 24 hours)

Réponse
 
LinkBack Outils de la discussion
Vieux 19/09/2007, 00h28   #1
brazil.mg.marcus.vinicius.lima
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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!

  Réponse avec citation
Vieux 19/09/2007, 00h54   #2
Roy Harvey (MVP)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to work with time in format 'hhh:mm:ss' (more than 24 hours)

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"
<marcvlima@gmail.com> wrote:

>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!

  Réponse avec citation
Vieux 19/09/2007, 03h25   #3
brazil.mg.marcus.vinicius.lima
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to work with time in format 'hhh:mm:ss' (more than 24 hours)

On 18 set, 20:54, "Roy Harvey (MVP)" <roy_har...@snet.net> wrote:
> 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.com> wrote:
> >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 -



  Réponse avec citation
Vieux 19/09/2007, 03h28   #4
brazil.mg.marcus.vinicius.lima
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to work with time in format 'hhh:mm:ss' (more than 24 hours)

On 18 set, 20:54, "Roy Harvey (MVP)" <roy_har...@snet.net> wrote:
> 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.com> wrote:
> >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!

  Réponse avec citation
Vieux 19/09/2007, 04h39   #5
Roy Harvey (MVP)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to work with time in format 'hhh:mm:ss' (more than 24 hours)

On Tue, 18 Sep 2007 19:28:20 -0700, "brazil.mg.marcus.vinicius.lima"
<marcvlima@gmail.com> wrote:

>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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h11.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09875 seconds with 13 queries