Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long,long IIf statement

Status
Not open for further replies.

writersoon

Technical User
Joined
Mar 4, 2008
Messages
12
Location
US
Does anyone know how to make these 3 IIf statements into one?

I am trying to put it all in one column and i keep recieving errors when i make input all 3 statments into 1 and change the query to a make table query.

Thanks in advance...


SELECT p.*, IIf([POType]="PO" And [NonStock]="N","NS", IIf([POType]="PO" And [Inventory Pos]>LinePt And [Days Available to Position]<91 And [NonStock]="","LP+U")) AS Comments
FROM p;

SELECT p.*, IIf([POType]="PO" And [NonStock]="N","NS",IIf([POType]="PO" And [Inventory Pos]<LinePt And QtyBO>0 And [NonStock]="","BO")) AS Comments
FROM p;

SELECT IIf([PO Type]="BO","Blkt Order",IIf([PO Type]="RM","PORM",IIf([PO Type]="WT","WHS Transfer",IIf([PO Type]="BL","Blkt Release",IIf([PO Type]="DO" And [NonStock]="N","NS Direct","Direct"))))) AS Comments, Review.*, * INTO [PO REVIEW ATTRIBUTES]
FROM P AS Review;
 
writersoon, reread carefully my post stamped 17 Mar 08 9:20 and compare your function definition with the suggested one.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top