|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with TIME field
Hi,
I am using SQL Server 2000. I made this following simple query: SELECT [TimeOperationBegan],[TimeOperationEnded], (DATEDIFF(minute,[TimeOperationBegan],[TimeOperationEnded])) AS Diftime FROM [ORRecord] The sample results are as follows: TimeOperationBegan |TimeOperationEnded |Diftime __________________________________________________ ________ 1899-12-30 10:40:00.000| 1899-12-30 11:22:00.000| 42 1899-12-30 11:41:00.000| 1899-12-30 11:52:00.000| 11 1899-12-30 16:03:00.000| 1899-12-30 16:32:00.000| 29 1899-12-30 23:05:00.000| 1899-12-30 00:32:00.000| -1353 How can i get rid of this negative value and make the query to calculate the difference between 23:05 and 24:32 for the fourth record?? Thanks in advance. VJ |
|
#2
|
|||
|
|||
|
For starters
24:32 on 1899-12-30 is not 1899-12-30 00:32:00.000| is really 1899-12-31 00:32:00.000| If you use this it will work Otherwise it really is a negative value S- |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Problem with TIME field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|