IIF State in query

G

Guest

Hi All,

I need some help writing a query that does a calculation with the lowest of
3 numbers. Here is apart of the query that does a compare between 2 fields.


Here is what I came up with but I am getting an error.
IIf([SalePrice]<[AppraisedValue],[SalePrice]*[LoanToValue],[AppraisedValue]*[LoanToValue])

Now i need to also look at BldrCost...if Bldrcost is lower than both
saleprice and appraised value then bldrcost as commitment amt.

IIf([SalePrice]<[AppraisedValue],[SalePrice]*[LoanToValue],[AppraisedValue]*[LoanToValue]
Or [Bldrcost] < [saleprice] Or[Bldrcost] < A[ppraisedvalue], [Bldrcost]) as
commitamt

Help...Where am I going wrong???
 
C

Carl Rapson

Natalie said:
Hi All,

I need some help writing a query that does a calculation with the lowest
of
3 numbers. Here is apart of the query that does a compare between 2
fields.


Here is what I came up with but I am getting an error.
IIf([SalePrice]<[AppraisedValue],[SalePrice]*[LoanToValue],[AppraisedValue]*[LoanToValue])

Now i need to also look at BldrCost...if Bldrcost is lower than both
saleprice and appraised value then bldrcost as commitment amt.

IIf([SalePrice]<[AppraisedValue],[SalePrice]*[LoanToValue],[AppraisedValue]*[LoanToValue]
Or [Bldrcost] < [saleprice] Or[Bldrcost] < A[ppraisedvalue], [Bldrcost])
as
commitamt

Help...Where am I going wrong???

You'll need to nest your IIf statements:

IIf(([Bldrcost]<[saleprice]) Or ([Bldrcost]<[AppraisedValue]), [Bldrcost],
IIf([SalePrice]<[AppraisedValue],[SalePrice]*[LoanToValue],[AppraisedValue]*[LoanToValue]))
As commitamt

Carl Rapson
 

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