"File As" MS Access 查询中的表达式
"File As" Expression in MS Access Query
我构建了一个查询,其中包含用于创建 "File As" 字段的表达式。对于查询,我有 ParticipantFName、ParticipantLName(组合在 "Owner" 字段中)和 BusinessName 字段。在 "File As" 字段中,如果 "Owner" 字段为空,它将添加 BusinessName(因此它将显示所有者或企业,以填写者为准)并且效果很好。现在我被要求为 TribeName 添加一个字段。
如果所有者为空,商家名称为空以显示部落名称,那么表达式是什么?我现在的表达是
File As: Nz([Owner],[BusinessName])
考虑嵌套 NZ()
函数:
File As: Nz([Owner], Nz([BusinessName], [TribeName]))
或者,使用 IIF():
File As: IIF([Owner] IS NOT NULL, [OWNER],
IIF([BusinessName] IS NOT NULL, [BusinessName],
IIF([TribeName] IS NOT NULL, [TribeName], NULL)))
我构建了一个查询,其中包含用于创建 "File As" 字段的表达式。对于查询,我有 ParticipantFName、ParticipantLName(组合在 "Owner" 字段中)和 BusinessName 字段。在 "File As" 字段中,如果 "Owner" 字段为空,它将添加 BusinessName(因此它将显示所有者或企业,以填写者为准)并且效果很好。现在我被要求为 TribeName 添加一个字段。
如果所有者为空,商家名称为空以显示部落名称,那么表达式是什么?我现在的表达是
File As: Nz([Owner],[BusinessName])
考虑嵌套 NZ()
函数:
File As: Nz([Owner], Nz([BusinessName], [TribeName]))
或者,使用 IIF():
File As: IIF([Owner] IS NOT NULL, [OWNER],
IIF([BusinessName] IS NOT NULL, [BusinessName],
IIF([TribeName] IS NOT NULL, [TribeName], NULL)))