DATETIME update | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive


Hi ! I would like to ask if there is a way to update only the time field of a datetime value.
For example : value 13/08/1984 12:10:00 to become 13/08/1984 12:00:00 Please help because it is urgent. Thanks
<pre id="code"><font face="courier" size="2" id="code"><br />DATEADD(MINUTE,-10, &lt;your_column&gt<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ /><br /></font id="code"></pre id="code"><br />If you always want to adjust to midday do:<br /><pre id="code"><font face="courier" size="2" id="code"><br />DATEADD(DAY, DATEDIFF(DAY, 0, &lt;your_column&gt<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />, 0) + .5<br /></font id="code"></pre id="code"><br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br />Contributing Editor, Writer & Forum Moderator<a target="_blank" href=></a><br />Webmaster:<a target="_blank" href=></a>