This scalar TSQL function calculates the last second of a given day (23:59:59) when passed a date in mm/dd/yyyy format. Useful for getting to the end of a day on reports that prompt the user for a date range.
(Read our blog for more information about user-defined functions in T-SQL.)
To download this report, please log in or create an account. →