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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using CONVERT with field value

Author  Topic 

rtcary
Starting Member

1 Post

Posted - 2009-10-05 : 11:09:51
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 SET
DateProcessed = CONVERT(nVarChar(8), s.ZdiDate,1),
WhoProcessed = 'todd',
Processed = 1
FROM CaseAdmin.dbo.RumDataZDI t
INNER JOIN _TmpSelectChecks s ON(s.ZdiRef = t.Ref)
WHERE s.Selected = 1

s.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)





KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -