I am trying to update the time only in my datetime column in SQL Server.
I have these columns in my tblAttendance2
DateTimeIn, DateTimeOut, UserID
I want to update the time for my time in and time out on a specific day (WHERE).
Thanks
This should work:
UPDATE tblAttendance2
SET DateTimeIn= CONVERT(varchar(10),DateTimeIn, 120) + ' 12:34:56'
WHERE DateTimeIn
BETWEEN '2012-06-07' AND '2012-06-07 23:59:59'
... edited.. I had MySQL syntax and not SQL2008 originally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With