Expression Builder Access 2K

R

Richard

My coworker has built a customer "database" that is actually a huge
spreadsheet within Access. It has about 110 fields in it.
One of the fields I am trying to clean up right now are check boxes for New
Customer 1999, New Customer 2000, etc.

I have this expression:
Expr1: IIf([New 1999 Customer?],1999)
and it works in the one case, but what I want is:
Expr1: IIf([New 1999 Customer?],1999) OR IIf([New 2000 Customer?],2000 OR
IIf([New 2001 Customer?],2001), etc

I would then make a new table with that query, and delete the old New xxxx
Customer? fields.

But IIF does not do this. Any tips?

Thanks in advance.
 
R

Richard

Richard said:
My coworker has built a customer "database" that is actually a huge
spreadsheet within Access. It has about 110 fields in it.
One of the fields I am trying to clean up right now are check boxes for
New Customer 1999, New Customer 2000, etc.

I have this expression:
Expr1: IIf([New 1999 Customer?],1999)
and it works in the one case, but what I want is:
Expr1: IIf([New 1999 Customer?],1999) OR IIf([New 2000 Customer?],2000 OR
IIf([New 2001 Customer?],2001), etc

I would then make a new table with that query, and delete the old New xxxx
Customer? fields.

But IIF does not do this. Any tips?

Thanks in advance.
Nevermind. A little more Googling helped:

Expr1: IIf([New 1999 Customer?],1999,IIf([New 2000 Customer?],2000,IIf([New
2001 Customer?],2001,IIf([New 2002 Customer?],2002,IIf([New 2003
Customer?],2003,IIf([New 2004 Customer?],2004,IIf([New 2005
Customer?],2005)))))))

A nested IIF. It isn't pretty, but it works!
 

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

Top