当前位置: 代码迷 >> Sql Server >> 这样 为什么提示shrq无效?解决思路
  详细解决方案

这样 为什么提示shrq无效?解决思路

热度:346   发布时间:2016-04-27 13:24:28.0
这样 为什么提示shrq无效?
SELECT a.Jydbh,  
  a.mddd,CONVERT(varchar(12) , a.Jhrq, 112 ) as shrq,
  a.Jhrq,
b.Clbh 

  FROM Jydxx as a left outer join Fhxx as b on a.Jydbh=b.Jydbh and 
  left(shrq,8) >= '20120403' and left(shrq,8) <= '20120408'

这样 为什么提示shrq无效

------解决方案--------------------
SQL code
SELECT     a.Jydbh,       a.mddd,CONVERT(varchar(12) , a.Jhrq, 112 ) as shrq,    a.Jhrq,    b.ClbhFROM Jydxx as a left outer join Fhxx as b on a.Jydbh=b.Jydbh and  --left(shrq,8) >= '20120403' and left(shrq,8) <= '20120408'datediff(day, '2012-04-03', a.shrq)>=0 and datediff(day, '2012-04-08', a.shrq)<=0
  相关解决方案