=================================================================
== PROCEDURE: COMBINE_DTM
==
== PURPOSE:
==
== CREATED:
==
== TYPE:
=================================================================*/
CREATE FUNCTION [dbo].[COMBINE_DTM] (
@inDATE_DTM AS datetime,
@inTIME_DTM AS datetime
) RETURNS datetime
AS
BEGIN
RETURN
CAST((ROUND(CAST(@inDATE_DTM AS float), 0, 1) ) AS float) +
(CAST(@inTIME_DTM AS float) - (ROUND(CAST(@inTIME_DTM AS float), 0, 1)) + .00000001)
END
use this links to original links
http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/ee161d81-8f04-4328-b2a8-a32f95c30b29/
or
http://blogs.msdn.com/patrickgallucci/archive/2007/11/18/sql-server-function-to-merge-a-date-with-a-time.aspx