Y
yedixifeng
Unregistered / Unconfirmed
GUEST, unregistred user!
正面这段代码是用来显示在DBGridEh上的,当字段STATUSwl=1时可以显示。由于这个是二次开发,表中STATUSwl有空值Null,当空值时如何写STATUSwl=什么?请高手指点,谢谢。 Sql := 'select a.*,b.ShortName,c.UserName OpUserName' +' from BilDepotMast a left join BasCustomer b on a.CustomerID=b.CustomerID' +' left join BasUser c on a.OpUserID=c.UserID'; if G_JYStyle in [2,5,6,9] then begin Sql := Sql + ' where 1=1'; end else begin Sql := Sql + ' where 1=2'; end; Sql := Sql+' and STATUSwl=1 and DepotFlag=0';//STATUSwl有1和空值 if Trim(WhlSql) <> '' then begin Sql := Sql+' and '+ WhlSql; end; Sql := Sql+' order by a.ValidDate desc';