Produced by Araxis Merge on 10/26/2017 10:43:32 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | OSCIF_BMS_v2_iter 2_September_2017.zip\BMS_Cand\BMS_Source_C72993\C72993-Sources.zip\C72993\Source\Sources\Database\CreationScripts\BMS_DW\2.Functions | dbo.ufn_GetDateDiff.UserDefinedFunction.sql | Fri Nov 22 17:02:52 2013 UTC |
| 2 | OSCIF_BMS_v2_iter 2_September_2017.zip\BMS_Cand\BMS_Source_C72993\C72993-Sources.zip\C72993\Source\Sources\Database\CreationScripts\BMS_DW\2.Functions | dbo.ufn_GetDateDiff.UserDefinedFunction.sql | Thu Oct 26 18:33:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 122 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /****** Ob ject: Use rDefinedFu nction [db o].[ufn_Ge tDateDiff] Script Date: 03/ 21/2012 16 :03:44 *** ***/ | |
| 2 | IF EXISTS (SELECT * FROM sys. objects WH ERE object _id = OBJE CT_ID(N'[d bo].[ufn_G etDateDiff ]') AND ty pe in (N'F N', N'IF', N'TF', N' FS', N'FT' )) | |
| 3 | DROP FUNCT ION [dbo]. [ufn_GetDa teDiff] | |
| 4 | GO | |
| 5 | ||
| 6 | SET ANSI_N ULLS ON | |
| 7 | GO | |
| 8 | SET QUOTED _IDENTIFIE R ON | |
| 9 | GO | |
| 10 | ||
| 11 | -- ======= ========== ========== ========== ======== | |
| 12 | -- Author:
|
|
| 13 | -- Create date: 10/2 4/2011 | |
| 14 | -- Descrip tion: Get Date diffe rence in h ours and minutes | |
| 15 | -- ======= ========== ========== ========== ======== | |
| 16 | CREATE FUN CTION [dbo ].[ufn_Get DateDiff] | |
| 17 | ( | |
| 18 | @START_DAT E DATETIME = NULL, | |
| 19 | @END_DATE DATETIME = NULL | |
| 20 | ) | |
| 21 | RETURNS VA RCHAR(70) | |
| 22 | AS | |
| 23 | BEGIN | |
| 24 | ||
| 25 | DE CLARE @RES ULT VARCHA R(70), @HO URS varcha r(30), @MI NUTES varc har(30), @ SECONDS va rchar(30) | |
| 26 | ||
| 27 | -- declare @m inutes int | |
| 28 | IF @START_DA TE IS NOT NULL AND @END_DATE IS NOT NUL L | |
| 29 | BE GIN | |
| 30 | ||
| 31 | SET @SECONDS = DATEDIFF( SECOND, @S TART_DATE, @END_DATE ) | |
| 32 | SET @HOURS = @ SECONDS / 3600 | |
| 33 | SET @MINUTES = (@SECONDS - (@HOURS * 3600)) / 60 | |
| 34 | ||
| 35 | IF L EFT(@HOURS ,1) = '-' | |
| 36 | BEGIN | |
| 37 | SET @HOU RS = RIGHT (@HOURS, L EN(@HOURS) -1) | |
| 38 | END | |
| 39 | ||
| 40 | IF L EFT(@MINUT ES,1) = '- ' | |
| 41 | BEGIN | |
| 42 | SET @MIN UTES = RIG HT(@MINUTE S, LEN(@MI NUTES) -1) | |
| 43 | END | |
| 44 | ||
| 45 | SET @HOURS = C ASE WHEN L EN(@HOURS) = 1 THEN '0' + @HOU RS | |
| 46 | ELSE @HOUR S END | |
| 47 | ||
| 48 | SET @MINUTES = CASE WHEN LEN(@MINU TES) = 1 T HEN '0' + @MINUTES | |
| 49 | ELSE @MINU TES END | |
| 50 | ||
| 51 | SET @RESULT = @HOURS + ' :' + @MINU TES | |
| 52 | ||
| 53 | IF @ RESULT <> '00:00' AN D @START_D ATE > @END _DATE | |
| 54 | BEGIN | |
| 55 | SET @RES ULT = '-'+ @RESULT | |
| 56 | END | |
| 57 | EN D | |
| 58 | EL SE | |
| 59 | S ET @RESULT = '' | |
| 60 | RE TURN @RESU LT; | |
| 61 | END | |
| 62 | GO |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.