Set Date based on Date and Priority fields

J

jz5sjg

Hi,

I would really appreciate any advice on the following Access 2002 forms
scenario:

3 fields:
- Priority (Combo box with values 1 and 2)
- Opened Date (read/write)
- Target Date (read only)

I would like to set the Target Date to:
(Date Opened) + (20 days if Priority = 1) OR (10 days if Priority = 2)

I can set the Target to increase by a fixed amount using:

=DateSerial(Year([Opened Date]),Month([Opened Date]),Day([Opened
Date])+10)

But cannot figure out how to base it on the priority field. Is it
simply a matter of including an IF statement and if so, what is the
syntax?

Thanks in advance for any help you can offer.
SPC
 
G

Guest

=DateSerial(Year([Opened Date]),Month([Opened Date]),Day([Opened
Date])+iif(Me.Priority =1,20,10))
 
J

jz5sjg

Klatuu, thanks very much for the prompt response, it worked!
=DateSerial(Year([Opened Date]),Month([Opened Date]),Day([Opened
Date])+iif(Me.Priority =1,20,10))

Hi,

I would really appreciate any advice on the following Access 2002 forms
scenario:

3 fields:
- Priority (Combo box with values 1 and 2)
- Opened Date (read/write)
- Target Date (read only)

I would like to set the Target Date to:
(Date Opened) + (20 days if Priority = 1) OR (10 days if Priority = 2)

I can set the Target to increase by a fixed amount using:

=DateSerial(Year([Opened Date]),Month([Opened Date]),Day([Opened
Date])+10)

But cannot figure out how to base it on the priority field. Is it
simply a matter of including an IF statement and if so, what is the
syntax?

Thanks in advance for any help you can offer.
SPC
 

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