请老师帮忙看一下这个sql语句vs2008调试时老是提示错误:'-' 附近有语法错误。但是在sqlserver可正常运行
sql语句如下:selects.requestnoas领料单号,m.wsid,m.request_timeas单据创建时间,(s.mintime+'~'+s.maxtim...
sql语句如下:select s.requestno as 领料单号,m.wsid,m.request_time as 单据创建时间,(s.mintime+'~'+s.maxtime) as 条码扫描时间段,d.matid,
d.request_amount as 请领量,s.zl as 实发量,m.space1 as 领料部门,m.requester as 领料人,s.creator as 扫码员,m.iscorrect as 是否正常,m.isprint as 是否已打印
from
(select top 100 a.REQUESTNO,sum(CONVERT(NUMERIC(18,2),AMOUNT)) as zl,max(a.CREATIONDATE) as maxtime,min(a.creationdate)as mintime,a.creator
from TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_SENT a
where a.CREATIONDATE>='2017-03-27 08:00:00' and a.CREATIONDATE <'2017-03-28 08:00:00' and a.RECORDFLAG='A'
group by a.REQUESTNO,a.creator ) s
LEFT JOIN TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_detail d on s.REQUESTNO=d.requestno
left join TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_Main m on s.REQUESTNO=m.requestno
where m.type='0' and m.status>='21' and s.creator like '%%' and m.space1 like '%%' 展开
d.request_amount as 请领量,s.zl as 实发量,m.space1 as 领料部门,m.requester as 领料人,s.creator as 扫码员,m.iscorrect as 是否正常,m.isprint as 是否已打印
from
(select top 100 a.REQUESTNO,sum(CONVERT(NUMERIC(18,2),AMOUNT)) as zl,max(a.CREATIONDATE) as maxtime,min(a.creationdate)as mintime,a.creator
from TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_SENT a
where a.CREATIONDATE>='2017-03-27 08:00:00' and a.CREATIONDATE <'2017-03-28 08:00:00' and a.RECORDFLAG='A'
group by a.REQUESTNO,a.creator ) s
LEFT JOIN TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_detail d on s.REQUESTNO=d.requestno
left join TIRE_FORMES.TIRE_FORMES.T_TB_RM_REQUEST_Main m on s.REQUESTNO=m.requestno
where m.type='0' and m.status>='21' and s.creator like '%%' and m.space1 like '%%' 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询