Unit of time | Query | Result |
NANOSECOND | SELECT DATEDIFF(NANOSECOND,'2011-09-23 17:15:22.5500000','2011-09-23 17:15:22.55432133') | 4321300 |
MICROSECOND | SELECT DATEDIFF(MICROSECOND,'2011-09-23 17:15:22.5500000','2011-09-23 17:15:22.55432133') | 4321 |
MILLISECOND | SELECT DATEDIFF(MILLISECOND,'2011-09-23 17:15:22.004','2011-09-23 17:15:22.548') | 544 |
SECOND | SELECT DATEDIFF(SECOND,'2011-09-23 17:15:30','2011-09-23 17:16:23') | 53 |
MINUTE | SELECT DATEDIFF(MINUTE,'2011-09-23 18:03:23','2011-09-23 17:15:30') | -48 |
HOUR | SELECT DATEDIFF(HH,'2011-09-23 18:03:23','2011-09-23 20:15:30') | 2 |
WEEK | SELECT DATEDIFF(WK,'09/23/2011 15:00:00','12/11/2011 14:00:00') | 12 |
DAY | SELECT DATEDIFF(DD,'09/23/2011 15:00:00','08/02/2011 14:00:00') | -52 |
DAYOFYEAR | SELECT DATEDIFF(DY,'01/01/2011 15:00:00','08/02/2011 14:00:00') | 213 |
MONTH | SELECT DATEDIFF(MM,'11/02/2011 15:00:00','01/01/2011 14:00:00') | -10 |
QUARTER | SELECT DATEDIFF(QQ,'01/02/2011 15:00:00','08/01/2011 14:00:00') | 2 |
YEAR | SELECT DATEDIFF(YY,'01/02/2011 15:00:00','01/01/2016 14:00:00') | 5 |
Here you will find about .net technology. also can get example about MVC.net and jquery.
Friday, April 12, 2013
SQL Server DateDiff Example
Subscribe to:
Post Comments (Atom)
Opps Part 1 : Abstraction
Abstraction in C# is a fundamental concept of object-oriented programming (OOP) that allows developers t...
-
<html> <body> <table> <tr><td>Text to Save:</td></tr> <tr> <td colspan="3...
-
SQL Server has several fixed database roles such as db_datareader and db_datawriter , which grants the user read and write access res...
-
Get Yahoo Contact for C# Create new Website Create AppCode Folder Create OAuthBase.cs in AppCode Folder like us...
No comments:
Post a Comment