Created
February 3, 2016 12:05
-
-
Save kwestground/255d260c6426930f5024 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION SBODateTimeToSQLDateTime | |
( | |
@Date datetime, @Time smallint | |
) | |
RETURNS datetime | |
AS | |
BEGIN | |
DECLARE | |
@Hour smallint = CAST(SUBSTRING(CAST(@Time as varchar(4)), 1, 2) AS smallint), | |
@Minute smallint = CAST(SUBSTRING(CAST(@Time as varchar(4)), 3, 2) AS smallint) | |
RETURN DATEADD(MINUTE, @Minute, DATEADD(HOUR, @Hour, @Date)) | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment