| 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...
 - 
exec xp_cmdshell 'net use Z: \\192.01.01.10\FileStorage [Password] /user: 192.01.01.10 \Administrator'(Username) --exec xp_c...
 - 
MaxDepth – A positive integer that specifies the maximum nested node depth per read. The default value is 32. Maximum is 2147483647. Ma...
 
No comments:
Post a Comment