Skip to content

Instantly share code, notes, and snippets.

@toxn12
Created April 12, 2017 14:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toxn12/6038eca81b0e2b7e6094884088808f49 to your computer and use it in GitHub Desktop.
Save toxn12/6038eca81b0e2b7e6094884088808f49 to your computer and use it in GitHub Desktop.
TimeToTicks.sql
CREATE FUNCTION [dbo].[TimeToTicks] (@hour int, @minute int, @second int)
RETURNS bigint
WITH SCHEMABINDING
AS
BEGIN
RETURN (((@hour * 3600) + CONVERT(bigint, @minute) * 60) + CONVERT(bigint, @second)) * 10000000
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment