Adds TIME portion of a DT to the DATE of another

UDF that returns a DATETIME which is the concatination of the TIME portion of one DATETIME and the DATE portion of another.EXAMPLES:DECLARE @Date DATETIME, @Time DATETIMESET @Date = '7/1/03 16:00'SET @Time = '5/16/1999 9:30 AM'PRINT dbo.FN_AddDateTime(@Date,@Time )RETURNS: Jul  1 2003  9:30AMPRINT dbo.FN_AddDateTime(@Date,0)RETURNS: Jul  1 2003 12:00AM

2003-07-01

80 reads

Blogs

Trouble writing? Join the club. #JustWriteTech

By

I was talking with  a couple of excellent SQL people* recently, and we were bemoaning...

Check Query Progress with Live Query Stats

By

This is something I touched on back in 2017 a little after the Live...

SQL Server 2019 on Docker no longer runs as root by default

By

In my home lab I have an Ubuntu virtual machine that runs both SQL...

Read the latest Blogs

Forums

Is Data the Future of the Vibrant Web?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Is Data the Future of...

how to list index corresponding to statistics using select statement

By ebooklub

Hi , with query bellow I  can list DTA  statistic that is not updated...

Get files based on SQL results

By Jay@Work

I have a sql task which queries a database and returns a result set...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers