Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove/null out time portion of date 1

Status
Not open for further replies.

password99

Technical User
Jul 19, 2002
122
US
how do i update the time portion of date column to be null in a update statement?

e.g. before 12/09/2004 23:20:06:357

after the update should be 12/09/2004 00:00:00
 
This will flatten the time
Code:
select dateadd(dd, datediff(dd,0,'12/09/2004 23:20:06:357'),0)

[bandito] [blue]DBomrrsm[/blue] [bandito]
 

same idea,

select dateadd(dd, datediff(dd, '01/01/2004', dateColumn), '01/01/2004') from Mytable

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top