Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
仅在SQL Server中的日期时间列中更新时间_Sql_Sql Server 2008_Datetime - Fatal编程技术网

仅在SQL Server中的日期时间列中更新时间

仅在SQL Server中的日期时间列中更新时间,sql,sql-server-2008,datetime,Sql,Sql Server 2008,Datetime,我正在尝试仅更新SQL Server中我的datetime列中的时间 我的tblAttendance2 DateTimeIn, DateTimeOut, UserID 我想更新我在特定日期的进出时间(WHERE) 谢谢这应该可以: UPDATE tblAttendance2 SET DateTimeIn= CONVERT(varchar(10),DateTimeIn, 120) + ' 12:34:56' WHERE DateTimeIn BETWEEN '2012-06

我正在尝试仅更新SQL Server中我的
datetime
列中的时间

我的
tblAttendance2

DateTimeIn, DateTimeOut, UserID
我想更新我在特定日期的进出时间(
WHERE

谢谢

这应该可以:

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'

。。。编辑。。我最初使用的是MySQL语法,而不是SQL2008。

您希望以什么方式更改它,您尝试了什么?