IIf problem

  • Thread starter Pete Provencher
  • Start date
P

Pete Provencher

Access 2000



I have three sales dates for property, (NBHD_Sales_Price_1,
NBHD_Sales_Price_2, NBHD_Sales_Price_3). I want to create a new field, which
I will update using a query. I want the query to look at the three dates and
to update the new field with the latest date. I attempted to write an IIF
statement to perform this operation but it errors out with :



The expression you entered has a function containing the wrong number of
arguments



My formula is;




IIF([NBHD_Sales_Price_3]>0),[NBHD_Sales_Price_3],(IIF([NBHD_Sales_Price_2]>0
),[NBHD_Sales_Price_2],[NBHD_Sales_Price_1])



Any help will be appreciated.





Pete Provencher
 
J

John Viescas

Your parens are in the wrong place:

IIF([NBHD_Sales_Price_3]>0,[NBHD_Sales_Price_3],IIF([NBHD_Sales_Price_2]>0,[
NBHD_Sales_Price_2],[NBHD_Sales_Price_1]))

But note that you're comparing you values to zero, not to each other.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
P

Pete Provencher

Worked great. thanks

Pete
John Viescas said:
Your parens are in the wrong place:

IIF([NBHD_Sales_Price_3]>0,[NBHD_Sales_Price_3],IIF([NBHD_Sales_Price_2]>0,[
NBHD_Sales_Price_2],[NBHD_Sales_Price_1]))

But note that you're comparing you values to zero, not to each other.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
Pete Provencher said:
Access 2000



I have three sales dates for property, (NBHD_Sales_Price_1,
NBHD_Sales_Price_2, NBHD_Sales_Price_3). I want to create a new field, which
I will update using a query. I want the query to look at the three dates and
to update the new field with the latest date. I attempted to write an IIF
statement to perform this operation but it errors out with :



The expression you entered has a function containing the wrong number of
arguments



My formula is;
IIF([NBHD_Sales_Price_3]>0),[NBHD_Sales_Price_3],(IIF([NBHD_Sales_Price_2]>0
),[NBHD_Sales_Price_2],[NBHD_Sales_Price_1])



Any help will be appreciated.





Pete Provencher
 

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

Top