日期:2014-05-17  浏览次数:20404 次

很急 是否到达是通过条件控制查询的,数据库没字段,现在要求加是否到达为检索条件,那位大侠帮帮忙?
   strSql += " case  when (SELECT count(1) FROM officedba.SellSend AS sod WHERE sod.FromType = '1' AND sod.FromBillID = s.ID)>0 then '已发货'     ";
            strSql += " when (select count(1) yp from dbo.SetlerBills sb  ";
            strSql += "  where sb.ContractID=s.ContractNo and sb.Yprice/s.TotalFee*100>=s.TalkProcess)>0 then '已达到'  ";
            strSql += "  else '未达到' end ispass  ";

这是查询的内容,加是否到达为检索条件

------解决方案--------------------

不明白
------解决方案--------------------
基本知道意思,表设计的问题,建议添加一个是否达到的状态栏位,这样查询起来就简洁了,而不 像现在这样做一个查询是否存在表记录来判断状态。