0

我有一个从 sql 检索值的 asp 网页...它显示没有值的字段..无论如何只显示具有值的字段..这是我的表

[] [][] “制造 Dt 和 Exp Dt 根据附件所附”

这个方括号包含空值..如果该字段为空,那么这个方括号将不会出现

必须纠正

在第一行中,我有 2 组方括号,在第二行中,我有 2 组中的值..我只需要显示具有第二行中的值的方括号..如果值为空,则不需要显示空括号。

sql查询

select I.[Old Product Code], I.[Trade Name], I.[Short Name], SUM(Quantity) as Qty,I.[Base Box UOM], SIH.[Customer Marks - 1] ,SIH.[Bill-to Name],SIH.[Bill-to Address], SIH.[Ship-to Name], SIH.[Ship-to Address], SIH.[Ship-to Address 2] ,SIH.[Ship-to City], SIH.[Ship-to Post Code],SIH.[Country of Origin of Goods],SIH.[Bill-to Address 2] ,SIH.[Bill-to City] , SIH.[Bill-to Post Code], CR.Name ,C.Contact,SIH.[Total Boxes], CASE when SIL.[Dimension Group Code] = 'IOL' then I.[Group Description] 
END ,
CASE
    when  I.[EPCG License] = 1 then 'EPCG'
end,
case
    when SIL.[Dimension Group Code] = 'IOL' then 'DEEC'
    when I.[DEEC Lic_] = 1 then 'DEEC'
end as abcd
from [Sales Invoice Header] SIH ,[Customer] C, [Country_Region] CR,
 [Sales Invoice Line]  SIL,[Item] I where I.No_ =  SIL.No_ and SIL.[Document No_]='PEXP1213-110' and SIH.No_ = SIL.[Document No_] and C.No_ =  SIH.[Bill-to Customer No_] and C.[Country_Region Code] = CR.Code group by I.[Old Product Code], I.[Trade Name], I.[Short Name], SIH.[Sell-to Customer Name],SIH.[Sell-to City],SIH.[Customer Marks - 1],SIL.[Dimension Group Code],I.[Group Description], SIH.[Country of Origin of Goods], SIH.[Ship-to Name],SIH.[Ship-to Address], SIH.[Ship-to Address 2] , SIH.[Ship-to City], SIH.[Ship-to Post Code],SIH.[Bill-to Name],SIH.[Bill-to Address],SIH.[Bill-to Address 2],SIH.[Bill-to City] , SIH.[Bill-to Post Code],SIH.[Total Boxes],C.Contact ,CR.Name,I.[Base Box UOM], I.[EPCG License],I.[DEEC Lic_]
4

1 回答 1

0

您需要以编程方式解决它

if cstr(rs("Old Product Code"))="[]" then
   response.write("")
else 
   response.write(rs("Old Product Code"))
end if
于 2012-12-12T09:30:06.277 回答