字段空值时如何显示?(50)

  • 主题发起人 yedixifeng
  • 开始时间
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';
 
Sql := Sql+' and (isnull(STATUSwl,0)=1 or isnull(STATUSwl,0)=0) and DepotFlag=0';//STATUSwl有1和空值
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
564
import
I
I
回复
0
查看
660
import
I
顶部