- CREATE FUNCTION [dbo].TotalTime
- (
- @StartTime DATETIME,
- @EndTime DATETIME
- )
- RETURNS Varchar(10)
- AS
- begin
- DECLARE @D VARCHAR(400)='31784'
- Declare @outTime Varchar(10);
- SELECT @D = DATEDIFF(SECOND,@StartTime,@EndTime)
- SELECT @outTime =CONVERT(VARCHAR(5), @D/60/60)
- + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @D/60%60), 2)
- + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @D % 60), 2)
- RETURN @outTime
- END
- GO
- SELECT dbo.TotalTime('2016-08-10 10:36:01.000','2016-08-10 19:25:45.000')
Tuesday 6 December 2016
SQL Function Get Total Time in HH:MM:SS
Subscribe to:
Post Comments (Atom)
Upload valid file in C#
protected bool CheckFileExtandLength(HttpPostedFile HtmlDocFile) { try { Dictionary<string, byte[]>...
-
CREATE TAblE #temp ( T_Name VARCHAR(50), T_Times BIGINT ) INSERT INTO #temp(T_Name,T_Times) VALUES ('ASHISH',4) IN...
-
Step 1: Open URL: https://portal.azure.com/#home Step2 : Click Manage Azure Active Director Step3: Click Enterprise Application Step 4: Ne...
-
Injection Injection flaws, such as SQL injection, LDAP injection, and CRLF injection, occur when an attacker sends untrusted data to an ...
No comments:
Post a Comment