多条数据插入问题
当天时间是 NewDate
iNSERT INTO UserSalary_Days(UserName,zz, createdate)
selecct username ,zz from sys_user
怎么把NewDate 也同时插入进去
------解决方案--------------------不要时间,只要日期是吧?
INSERT INTO UserSalary_Days(UserName,zz, createdate)
selecct username ,zz ,convert(varchar(10),getdate(),120) from sys_user
------解决方案--------------------wubin123456(1) ( ) 信誉:100 Blog 2007-03-16 15:48:49 得分: 0
我这个日期是个变量不是系统时间???
---------
一樣的做法
Declare @Dt DateTime
Select @Dt = '2007-03-01 '
iNSERT INTO UserSalary_Days(UserName,zz, createdate)
select username ,zz, @Dt from sys_user
------解决方案--------------------wubin123456(1) ( ) 信誉:100 Blog 2007-03-16 15:48:49 得分: 0
我这个日期是个变量不是系统时间???
当天时间是 NewDate?
declare @dt datetime
set @dt= '2007-01-01 '
iNSERT INTO UserSalary_Days(UserName,zz, createdate)
select username ,zz,@dt from sys_user