Update Query Help

A

Alex

I have the following expression in an update query. It works until I add
"IIf(([ExcelARefParts].[NPC]="")" which gives me a type conversion error
when importing. Is there a way to change the below code to look to see if
[ExcelARefParts].[NPC] is null? All my fields in the table and form have the
correct/matching data types. NPC is a number and NHL is text, Qty and QtyTop
are both number. Thanks.

IIf(IsNull([ExcelARefParts].[NPC]) And
([AllNewParts].[NHL]<>"Top"),[TargetNPCCost]*[AllNewParts].[Qty],IIf(IsNull([ExcelARefParts].[NPC])
And
([AllNewParts].[NHL]="Top"),[TargetNPCCost]*[AllNewParts].[QtyTop],IIf(([ExcelARefParts].[NPC]="")
And
([AllNewParts].[NHL]<>"Top"),([TargetNPCCost]*[AllNewParts].[Qty])-[ExcelARefParts].[NPC],([TargetNPCCost]*[AllNewParts].[QtyTop])-[ExcelARefParts].[NPC])))
 
A

Allen Browne

A Number can be Null or some numeric value.
It cannot be a zero-length string, so testing for a zls will fail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top