类型:转载 责任编辑:asp.net 日期:2007/05/23
热门软件下载:
sql 语句:
insert into temp
select sum(price),pername,dateadd(month,-1,getdate()),1 from pro_ioput where type=2 and datediff(month,modtime,getdate())=1 group by pername
temp 结构:
price bigint
pername char(20)
modtime datetime
type int
pro_ioput结构:
price int
pername char(20)
modtime datetime
出错信息:
服务器: 消息 8114,级别 16,状态 5,行 2
将数据类型 varchar 转换为 bigint 时出错。
网友回答:
insert into [temp](price,pername,modtime,type) --可能是字段顺序问题,写清楚字段顺序
select sum(price),pername,dateadd(month,-1,getdate()),1
from pro_ioput
where type=2
and datediff(month,modtime,getdate())=1
group by pername