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

85 reads

Blogs

Thanks Kathi and Mala

By

I have to thank Kathi and Mala for putting on the WIT Mental Health...

Goal Progress for April 2021

By

I set goals at the beginning of the year, and I’m tracking my progress...

Daily Coping 7 May 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Checking Up on Vendors

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Checking Up on Vendors, which...

Upgrade 2014 Web Edition to Standard

By @SQLNumpty

Hello. I'm working with a client who currently has a SQL 2014 Web Instance...

Package failing but the table is already there and the system says its missing!!

By hurricaneDBA

Dear Everyone Im using SSIS 2019 and VS 2019 The data scientist gave me...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers