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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change time part

Status
Not open for further replies.

draganss

Programmer
Jan 13, 2006
47
MK
How can I change only the time part of DateTime field?

ex. '2011-01-01 01:00:00' to '2011-01-01 00:00:00'
'2011-01-01 03:45:00' to '2011-01-01 00:00:00'
'2011-02-05 22:01:15' to '2011-02-05 00:00:00'

Thank you
 
my lazy answer for this is:
Code:
UPDATE daTable   
SET datetimecol = [b]left(datetimecol,11)[/b]

If [blue]you have problems[/blue], I want [green]source code[/green] AND [green]error messages[/green], none of this [red]"there was an error crap"[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top