duedate

G

gmenon100

I am a novice to Access and I have a small Access project file and need to
use the below, can some help me with formulating :

[subdate], [duedate] & [shipmode] being the fields in a query.

i want to formulate

[duedate] = if [shipmode] = "AIR", duedate + 30 days
if [shipmode] = "OCEAN" duedate + 60days
 
A

AkAlan via AccessMonster.com

in the duedate field use an IIF statement

IIF([shipmode] = "Air","30","60")
This will only work if there are only two shipmodes. If there are more you
can use nested IIF statements otherwise I would write a function to handle it.


I am a novice to Access and I have a small Access project file and need to
use the below, can some help me with formulating :

[subdate], [duedate] & [shipmode] being the fields in a query.

i want to formulate

[duedate] = if [shipmode] = "AIR", duedate + 30 days
if [shipmode] = "OCEAN" duedate + 60days
 
R

Robert Morley

If this is an Access project and you're using a SQL Server back end, then
IIF won't work; use a CASE statement.

Instead of "shipmode", you would enter "CASE [shipmode] WHEN 'AIR' THEN
[duedate] + 30 WHEN 'OCEAN' THEN [duedate] + 60 END"



Rob
 
G

gmenon100 via AccessMonster.com

Thank you Robert, It worked with the case statement. I really appreciate your
help. This was my first Access project and my first posting. I may need some
help as I advance further. Thanks again.

Robert said:
If this is an Access project and you're using a SQL Server back end, then
IIF won't work; use a CASE statement.

Instead of "shipmode", you would enter "CASE [shipmode] WHEN 'AIR' THEN
[duedate] + 30 WHEN 'OCEAN' THEN [duedate] + 60 END"

Rob
I am a novice to Access and I have a small Access project file and need to
use the below, can some help me with formulating :
[quoted text clipped - 5 lines]
[duedate] = if [shipmode] = "AIR", duedate + 30 days
if [shipmode] = "OCEAN" duedate + 60days
 
G

gmenon100 via AccessMonster.com

Thanks Alan,

It worked with the CASE statement given by Robert. Appreciate your response.
in the duedate field use an IIF statement

IIF([shipmode] = "Air","30","60")
This will only work if there are only two shipmodes. If there are more you
can use nested IIF statements otherwise I would write a function to handle it.
I am a novice to Access and I have a small Access project file and need to
use the below, can some help me with formulating :
[quoted text clipped - 5 lines]
[duedate] = if [shipmode] = "AIR", duedate + 30 days
if [shipmode] = "OCEAN" duedate + 60days
 

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

Similar Threads


Top