Multiple IIf

  • Thread starter quinto via AccessMonster.com
  • Start date
Q

quinto via AccessMonster.com

Needs some help

If code =1,Action Date,+365, if code =2,Action Date, +730, If code=3,Action
Date+30
Can someone help with this and how many If can I use?

If code =1, or =4, or =5,Action Date,+365, if code =2, Action Date,+730, If
code=3,Action Date,+30
If this is dispalyed in a form can I allow edits to the expression results?

Thanks

Quinto
 
D

Duane Hookom

I would create a small code table with the numbers to add. Make sure the
Code field is the primary key
tblCodeAdds
Code DaysToAdd
1 365
2 730
3 30

Then add this table to your query and join the Code fields. You can now
create an expression ot
NewDate: [Action Date] + [DaysToAdd]

IMO, any attempt to create a nested IIf() statement is wrong.
 
Q

quinto via AccessMonster.com

I finally figured out the IIf expression but, I am going to change it to you
suggestion so I can add codes or change the number of days if I have to.

Thanks a million

Quinto

Duane said:
I would create a small code table with the numbers to add. Make sure the
Code field is the primary key
tblCodeAdds
Code DaysToAdd
1 365
2 730
3 30

Then add this table to your query and join the Code fields. You can now
create an expression ot
NewDate: [Action Date] + [DaysToAdd]

IMO, any attempt to create a nested IIf() statement is wrong.
Needs some help
[quoted text clipped - 12 lines]
 

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