Expression to choose most current from 4 date fields

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
 
T

Troy Berardo

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
 

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