Expression in query give me the wrong result

Johnrg

Registered User.
Local time
Tomorrow, 11:12
Joined
Sep 25, 2008
Messages
115
Guys,

I have the following expression in a query:

The "required" feild in this query always has data in it, "oddespatchdate" feild sometimes does, sometimes does not depending on user input.

I want the "required" feild to show if "oddespatchdate" is blank but the "oddespatchdate" to show if both feilds contain data.

unfortunatlly the expression always returns the "required" data regardless if there is data in the "oddespatchdate" feild or not.

can anyone let me know where i have gone wrong

Expr1: IIf(IsNull([orderdetailsoriginal].[oddespatchdate]),[orders].[required],[orderdetailsoriginal].[oddespatchdate])
 
I can't see what is wrong.
However note that the NZ() function can do the same job more neatly.
 
It could be that you might need to check for empty strings ("") as well as Nulls, so this:

Expr1: IIf(Len([orderdetailsoriginal].[oddespatchdate] & "")=0,[orders].[required],[orderdetailsoriginal].[oddespatchdate])
 

Users who are viewing this thread

Back
Top Bottom