You cannot really remove the date component of a DateTime Field. You can, however, set all dates to Jan 1, 1900 while preserving the time component, like this...
Code:
declare @Temp Table(Data DateTime)
Insert Into @Temp Values('20060831 10:00:00')
Update @Temp Set Data = Data - DateDiff(Day, 0, Data)
Select * From @TEmp
Note that this is actually using a table variable so you can safely copy/paste this to Query Analyzer and run it without affecting any data in any tables.
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.