Sql IIF语句拒绝返回Null

Sql IIF语句拒绝返回Null,sql,ms-access,Sql,Ms Access,我已经得到了上面的sql代码,我想要的是这个输出: SELECT TInvoiceDetails.ProductID, IIF([ProductID]="APP-001",Null,[TInvoiceDetails].[#of]) AS [#of] ProductID | #of ____________________ APP-001 | something else | 12 我得到的是这个输出: SELECT TInvoiceDetails.ProductID

我已经得到了上面的sql代码,我想要的是这个输出:

SELECT TInvoiceDetails.ProductID, IIF([ProductID]="APP-001",Null,[TInvoiceDetails].[#of]) AS [#of]
ProductID      | #of
____________________
APP-001        | 
something else | 12
我得到的是这个输出:

SELECT TInvoiceDetails.ProductID, IIF([ProductID]="APP-001",Null,[TInvoiceDetails].[#of]) AS [#of]
ProductID      | #of
____________________
APP-001        | 
something else | 12
基本表是:

ProductID      | #of
______________________
APP-001        | 2500
something else | 12

由于我对LL?\-000使用了一个输入掩码,因此解决方案是:

ProductID      | #of
______________________
APP-001        | 2500
something else | 12

不确定访问权限,但您可能应该使用
'APP-001'
@honeybacker,这实际上没有帮助。可能是空格或不可打印的字符?您可以检查产品ID中的隐藏字符(
len(ProductID)
)对于APP-001应该是7)尝试
IIf(Trim([ProductID])Null,[TInvoiceDetails].[f])