Is there any way to shorten the length of this calculated field in Access?

bentley1

Board Regular
Joined
Aug 17, 2012
Messages
85
Right now I have a long if statement that states:

Code:
Field1: IIf([AV].[Date]>=[Date10] And [Date10] Is Not Null,[Date10],IIf([AV].[Date]>=[Date9] And [Date9] Is Not Null,[Date9],IIf([AV].[Date]>=[Date8] And [Date8] Is Not Null,[Date8],IIf([AV].[Date]>=[Date7] And [Date7] Is Not Null,[Date7],IIf([AV].[Date]>=[Date6] And [Date6] Is Not Null,[Date6],IIf([AV].[Date]>=[Date5] And [Date5] Is Not Null,[Date5],IIf([AV].[Date]>=[Date4] And [Date4] Is Not Null,[Date4],IIf([AV].[Date]>=[Date3] And [Date3] Is Not Null,[Date3],IIf([AV].[Date]>=[Date2] And [Date2] Is Not Null,[Date2],IIf([AV].[Date]>=[Date1] And [Date1] Is Not Null,[Date1],[AV].[Effective_Date]))))))))))

It is getting too long (the "date" fields are actually longer and I can't add date11 without exceeding the limit for text). Is there any way to make this query shorter? I don't think I could do select cases in access but I am not really sure
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Upvote 0

Forum statistics

Threads
1,221,905
Messages
6,162,770
Members
451,786
Latest member
CALEB23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top