-
Recent Posts
Personal Links
SQL Server Links
Windows OS
Meta
Daily Archives: 7. April 2008
Getting HH:MM:SS value from Seconds
Here is another handy date manipulation function. This one converts the number of seconds, expressed as an int, into the HH:MM:SSS format SELECT CASE WHEN @seconds/3600<10 THEN '0' ELSE ” END + RTRIM(@seconds/3600) + ':' + RIGHT('0'+RTRIM((@seconds % 3600) / … Continue reading
Posted in T-SQL
Comments Off on Getting HH:MM:SS value from Seconds
Stripping the time component from a datetime value
Here is a very simple and elegant way to strip the time component from a datetime value: CAST(FLOOR(CAST(@date AS float)) AS datetime) Written as a function: CREATE FUNCTION BareDate ( — Add the parameters for the function here @date datetime … Continue reading
Posted in SQL Server
Comments Off on Stripping the time component from a datetime value