IIf Statement

D

D

Hi:

I have two IIf statements; I did the split cause I could not get them into
one. I would please need jut one field called Value_Date.
Is there a way to consolidate them?

Thank you,

Dan

1. Value_Date: iif([P_Subtp] = "FWD" and [T_date]<[rpt_date],0,[T_date]
2. Value_Date1: iif([P_Subtp] <> "FWD" and [S_date]<[rpt_date],0,[S_date]
 
R

RonaldoOneNil

Value_Date: iif([P_Subtp] =
"FWD",iif([T_date]<[rpt_date],0,[T_date]),iif([S_date]<[rpt_date],0,[S_date]))
 
M

Michel Walsh

In fact, if that should return one value_date, that makes 3 cases:

case 1: NOT( [P_Subtp] = "FWD" and [T_date]<[rpt_date] )
return T_date
case 2: NOT( [P_Subtp] <> "FWD" and [S_date]<[rpt_date] )
return S_date
case else:
return 0


so:


Value_Date: Switch(
NOT( [P_Subtp] = "FWD" and [T_date]<[rpt_date] ) , T_date,
NOT( [P_Subtp] <> "FWD" and [S_date]<[rpt_date] ), S_date,
true, 0 )



Vanderghast, Access MVP
 
D

D

Would that take in consideration when [P_subtp]<> "FWD"

Thank you Ronaldo!



RonaldoOneNil said:
Value_Date: iif([P_Subtp] =
"FWD",iif([T_date]<[rpt_date],0,[T_date]),iif([S_date]<[rpt_date],0,[S_date]))

D said:
Hi:

I have two IIf statements; I did the split cause I could not get them into
one. I would please need jut one field called Value_Date.
Is there a way to consolidate them?

Thank you,

Dan

1. Value_Date: iif([P_Subtp] = "FWD" and [T_date]<[rpt_date],0,[T_date]
2. Value_Date1: iif([P_Subtp] <> "FWD" and [S_date]<[rpt_date],0,[S_date]
 
R

RonaldoOneNil

Yes, because the 3rd iif is the False part to the 1st iif - or in other
words when [P_subtp]<> "FWD"

D said:
Would that take in consideration when [P_subtp]<> "FWD"

Thank you Ronaldo!



RonaldoOneNil said:
Value_Date: iif([P_Subtp] =
"FWD",iif([T_date]<[rpt_date],0,[T_date]),iif([S_date]<[rpt_date],0,[S_date]))

D said:
Hi:

I have two IIf statements; I did the split cause I could not get them into
one. I would please need jut one field called Value_Date.
Is there a way to consolidate them?

Thank you,

Dan

1. Value_Date: iif([P_Subtp] = "FWD" and [T_date]<[rpt_date],0,[T_date]
2. Value_Date1: iif([P_Subtp] <> "FWD" and [S_date]<[rpt_date],0,[S_date]
 
D

D

Thanks a lot Michel!

I will try and let you know.

Thanks again,

Dan

Michel Walsh said:
In fact, if that should return one value_date, that makes 3 cases:

case 1: NOT( [P_Subtp] = "FWD" and [T_date]<[rpt_date] )
return T_date
case 2: NOT( [P_Subtp] <> "FWD" and [S_date]<[rpt_date] )
return S_date
case else:
return 0


so:


Value_Date: Switch(
NOT( [P_Subtp] = "FWD" and [T_date]<[rpt_date] ) , T_date,
NOT( [P_Subtp] <> "FWD" and [S_date]<[rpt_date] ), S_date,
true, 0 )



Vanderghast, Access MVP


D said:
Hi:

I have two IIf statements; I did the split cause I could not get them into
one. I would please need jut one field called Value_Date.
Is there a way to consolidate them?

Thank you,

Dan

1. Value_Date: iif([P_Subtp] = "FWD" and [T_date]<[rpt_date],0,[T_date]
2. Value_Date1: iif([P_Subtp] <> "FWD" and [S_date]<[rpt_date],0,[S_date]
 
D

D

Thank you very much, Ronaldo!

Dan

RonaldoOneNil said:
Yes, because the 3rd iif is the False part to the 1st iif - or in other
words when [P_subtp]<> "FWD"

D said:
Would that take in consideration when [P_subtp]<> "FWD"

Thank you Ronaldo!



RonaldoOneNil said:
Value_Date: iif([P_Subtp] =
"FWD",iif([T_date]<[rpt_date],0,[T_date]),iif([S_date]<[rpt_date],0,[S_date]))

:

Hi:

I have two IIf statements; I did the split cause I could not get them into
one. I would please need jut one field called Value_Date.
Is there a way to consolidate them?

Thank you,

Dan

1. Value_Date: iif([P_Subtp] = "FWD" and [T_date]<[rpt_date],0,[T_date]
2. Value_Date1: iif([P_Subtp] <> "FWD" and [S_date]<[rpt_date],0,[S_date]
 

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