Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I do not want to have the time component in the destination field. The following code includes the time component, however if GETDATE() is used, the time component is NOT included. Is there a work around?UPDATE CaseAdmin.dbo.RumDataZDI SETDateProcessed = CONVERT(nVarChar(8), s.ZdiDate,1),WhoProcessed = 'todd',Processed = 1FROM CaseAdmin.dbo.RumDataZDI tINNER JOIN _TmpSelectChecks s ON(s.ZdiRef = t.Ref)WHERE s.Selected = 1s.ZdiDate is a DateTime field and it only contains Date data; no Time data.
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-10-05 : 11:12:55
for datetime data type, the time is always there. Use the code below to set it to midnight 00:00:00
SET DateProcessed = dateadd(day, datediff(day, 0, s.ZdiDate), 0)