IIF query not returning result.

dfuas

Registered User.
Local time
Today, 19:02
Joined
Jan 4, 2006
Messages
66
Hi,

Can anyone see anything wrong with this query?

I have 10 combo boxes where years are selected. If the last year nothing is selected (meaning is empty) then my query should return the last selected value. It seems the IIF query does not seem to work (Still showing empty). Can you please advise and help me on this?

The query I am using is shown below.

Thank you

dfuas


IIF([Trade].[Vintage_ to] = ' ',([Trade].[Vintage_from9]) OR ([Trade].[Vintage_from8]) OR ([Trade].[Vintage_from7]) OR ([Trade].[Vintage_from6]) OR ([Trade].[Vintage_from6]),[Trade].[Vintage_ to]) AS [Vintage to]
 
I am trying to achieve the following:

If ([Trade].[Vintage_ to] field is empty then look at the ([Trade].[Vintage_from9]) value and return this value or if this is also empty return the next which is ([Trade].[Vintage_from8]). ie. return the 1st no empty value between ([Trade].[Vintage_from9]) and ([Trade].[Vintage_from1]).
 
Thank you. I will try this.
 

Users who are viewing this thread

Back
Top Bottom