how to get time from datetime field and merge new date
I have a table with 2 fields. A date field and a datetime field. What I need to do is replace the date within the datetime field and keep the time. The date of course would be the date in the other field. Is there any what to do that within sql transactions.
UPDATE transact
SET CREATEDDATE = DATEADD(d, DATEDIFF(d, TRANSDATE, CREATEDDATE)* -1, CREATEDDATE)
WHERE (TRANSDATE >= '04/07/2015')