IIF/UpdateQuery/AppendQuery???

  • Thread starter Thread starter susan
  • Start date Start date
S

susan

This morning I got help with the IIF statement but now it got a little more
complicated (to me):

the original:
If StdPrice = 0, give me "rebill"
If Part# ends with "OSP",give me "outside processing"

now in addition i need:
If StdPO > or = 0, "Performance"
If StdPO < 0, "Economics"

This is what I did:

IIf([StdPrice]=0, "Rebill", IIf([StdPO]<0, "Economics", IIf([StdPO]>0,
"Performance", IIf(Right([Item Number],3)="OSP", "Outside Processing",""))))

My problem:
[StdPO] - this is a calculated field
Std-PO: [StdPrice]-[POFunctionalPrice]

So I guess my IIF is not working because it is using another calculation
that the query is calculating at the same time! How can I do this
calculation? 2 different queries? Suggestions please!

Thanks!
Susan




=IIF([StdPrice]=0,"rebill",IIF(Right([Part#],4)="-OSP","outside
processing","neither rebill nor outside"))
 
How can I do this calculation?
If it is using the same table then just repeat it in this query.

According to your IIF statement you could possibly have one of the following
as output --
Rebill
Economics
Performance
Outside Processing
or nothing.

It seems to me you would never get to the fourth IIF statement as you
checked for zero, less than zero, and greater than zero.
--
KARL DEWEY
Build a little - Test a little


susan said:
This morning I got help with the IIF statement but now it got a little more
complicated (to me):

the original:
If StdPrice = 0, give me "rebill"
If Part# ends with "OSP",give me "outside processing"

now in addition i need:
If StdPO > or = 0, "Performance"
If StdPO < 0, "Economics"

This is what I did:

IIf([StdPrice]=0, "Rebill", IIf([StdPO]<0, "Economics", IIf([StdPO]>0,
"Performance", IIf(Right([Item Number],3)="OSP", "Outside Processing",""))))

My problem:
[StdPO] - this is a calculated field
Std-PO: [StdPrice]-[POFunctionalPrice]

So I guess my IIF is not working because it is using another calculation
that the query is calculating at the same time! How can I do this
calculation? 2 different queries? Suggestions please!

Thanks!
Susan




=IIF([StdPrice]=0,"rebill",IIF(Right([Part#],4)="-OSP","outside
processing","neither rebill nor outside"))

susan said:
I need help with an IIF statement for the following:

If StdPrice = 0, give me "rebill"
If Part# ends with "-OSP",give me "outside processing"

I got the first part to get "rebill" but I can't figure out how to write the
"part# ends with -OSP"...

Please help!
Thanks,
Susan
 
Back
Top