Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding DATEDIFF()
Message
 
 
To
16/04/2015 16:01:44
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01618557
Message ID:
01618564
Views:
46
>If I have this:
>
>
>SELECT SUM(DATEDIFF(d,Holiday.Start,Holiday.End))
>
>
>...I can obtain 365.
>
>Now, if I change the type to s, to obtain this same amount in seconds:
>
>
>SELECT SUM(DATEDIFF(s,Holiday.Start,Holiday.End))
>
>
>...I obtain 23533200.
>
>However, If I do 23533200/84600, I do not obtain 365 days but only 272.38.
>
>What am I missing?

Do you always have Start and end as 12 AM ?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform