Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Minutes question

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-04-29 : 15:55:57
Greetings,

Given the following table structure, why am I getting the 510 minutes for these rows when doing (DATEDIFF(mi,ShiftStartDateTime, ShiftEndDateTime)) AS Minutes. This is crazy losing my mind! Should it not be 450?


2 1899-12-30 04:00:00.000 1899-12-30 12:30:00.000 510
3 1899-12-30 04:00:00.000 1899-12-30 12:30:00.000 510
4 1899-12-30 04:00:00.000 1899-12-30 12:30:00.000 510
5 1899-12-30 04:00:00.000 1899-12-30 12:30:00.000 510
6 1899-12-30 04:00:00.000 1899-12-30 12:30:00.000 510


<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-29 : 16:05:06
I come up with 510 too. Here's the math: (8*60)+30=510.

How did you come up with 450?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-04-29 : 16:08:54
are you serious !?!? I did have breakfast but not lunch and I am not smoking joint, never have.
1899-12-30 04:00:00.000 1899-12-30 12:30:00.000
4:00am to 12:30pm is 7 hours and 30 minutes. NO?!?!

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-29 : 16:09:39
No, it's 8 hours and 30 minutes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-04-29 : 16:14:19
my goodness! gone bonkers here, been staring at my screen for too long, time for nice juicy burger with all the trimmings and a nice shot of red sniper beer.
anyone else want to join me

Thanks Tara
This proves I am or I am not crazy?

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-04-29 : 16:16:53
I'll see you at the pub this evening.

You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -