I'm trying to create this inside of a query

smichaels1234

Registered User.
Local time
Today, 09:09
Joined
May 12, 2008
Messages
64
Division : IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="D",2 Or "I",3)
 
What if [SalesOrdersDivision] does not equal D or I?
 
Well, then it just goes to both.
 
Division : IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="D",2 Or "I",3)
I think this should do it
Code:
Division : IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="D",2, ([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="I",23))
Are 'D' and 'I' the only possibilities?
If not, and there's some catch-all value for the rest (say 4), try this
Code:
Division : IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="D",2, ([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]="I",3,4))
 
I just read your reply to Ken's post.
When you say both, do you mean 23, 2+3, or what?

If it's the former, replace the 4 in the second one I wrote with 23.
 
What you gave me worked. I am all set. I was looking for either an I or a D if not give me both. It helped me. I needed to do a little cleaning up but it definitely pointed me in the right direction. Thank you.
 
This is what I was trying to do, I will just post it:

IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]=2,"D",IIf([Forms]![frm-Shippable Items w/Detail]![SalesOrdersDivision]=3,"I",[division]))
 

Users who are viewing this thread

Back
Top Bottom