A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IIF/UpdateQuery/AppendQuery???



 
 
Thread Tools Display Modes
  #1  
Old July 9th, 2008, 09:15 PM posted to microsoft.public.access.queries
Susan
external usenet poster
 
Posts: 651
Default IIF/UpdateQuery/AppendQuery???

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" wrote:

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


  #2  
Old July 9th, 2008, 11:15 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default IIF/UpdateQuery/AppendQuery???

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" wrote:

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" wrote:

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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.