Hi, hovercraft....here's a short and simple way if you always only have three fields. There may be some better ways, but I would do the following:
Copy/Paste the following code into a new module in your database...Save the Module with the name of basGetMaxDate
Code:
Public Function GetMaxDate(dteDate1 As Date, dteDate2 As Date, dteDate3 As Date) As Date
Dim dteMaxDate As Date
dteMaxDate = dteDate1
If dteDate2 > dteMaxDate Then dteMaxDate = dteDate2
If dteDate3 > dteMaxDate Then dteMaxDate = dteDate3
GetMaxDate = dteMaxDate
End Function
Then in your query, put the following into the Field row of an empty column:
Code:
TheMax: GetMaxDate([date1],[date2],[date3])
Of course, change the date1, date2 and date3 to the names of your three date fields. And you can change TheMax to some other nicer name if you want - like TheMaxDate or MaxDate.
That should just about do it. If you need some explanation of what I did here, let me know.
Final note is that this works for three fields and three fields only. If you needed more fields, I think you can see how to adapt it.
Final Final note is that if you are storing dates such as this, you may not be using the best method to store your data - i.e. not fully normalized - depending on the data you are storing. You may want to search this site for some posts on normalization and see if thy might be able to help you out.
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer