Expression to choose most current from 4 date fields

  • Thread starter Thread starter S Jackson
  • Start date Start date
S

S Jackson

I have a text box on a report. I want the text box to compare four
different date fields and choose the most recent date. The names of the
fields are:

RFA, RFP, RFI and ROG.
Is there a way to do this without a huge long If statement?

TIA
S. Jackson
 
If you are just looking for other ways to do it, I can think of a few but
they'd probably be more work than just doing the nested If statement. The
following assume that the four fields are stored in the same table:

1.
- on open of the report, dump the four separate fields into one field in a
temp table
- then do a DMax lookup on the table or run a query to return the max date
in that field

2.
- create a function with four fields as parameters
- on open of the report, pass the fields to the function which will return
the most recent
- this would be like doing it in the report itself, but if there are
multiple reports needed this, then you wouldn't have to code the nested If
all over the place

Troy
 
Back
Top