Hello All,
Recently I was asked to make some changes to some business logic for a report generator I created for our office. Basically what I'm trying to do is this:
1)Evaluate a Date Field
2)If it's populated, leave it alone
3)If it's null, Evaluate a Shipping port field
4)If it's a California port add 50 days
5)If it's a NJ port add 70 days
6)If it's anything else add 60 days.
Can someone help me with the format please? Here is what I'm thinking of using for this, but I'm not sure if it will work. I also would like a "trap all" condition for anything that might sneak in there other then the 3 I know for sure can occur.
Thanks to any and all who can help me out with this, I sincerely appreciate it.
Recently I was asked to make some changes to some business logic for a report generator I created for our office. Basically what I'm trying to do is this:
1)Evaluate a Date Field
2)If it's populated, leave it alone
3)If it's null, Evaluate a Shipping port field
4)If it's a California port add 50 days
5)If it's a NJ port add 70 days
6)If it's anything else add 60 days.
Can someone help me with the format please? Here is what I'm thinking of using for this, but I'm not sure if it will work. I also would like a "trap all" condition for anything that might sneak in there other then the 3 I know for sure can occur.
Thanks to any and all who can help me out with this, I sincerely appreciate it.
Code:
zdatecalc: IIf(Eval(IsNull([ETA Date])),IIf([portcalc]="Long Beach, CA",DateAdd("d",50,[Prod Date]),IIf([portcalc]="Newark, NJ",DateAdd("d",70,[Prod Date]),IIf([portcalc]="TBD",DateAdd("d",60,[Prod Date]),[ETA Date]))))
Comment