Maximum Date

baylisj

New Member
Joined
Jan 9, 2003
Messages
38
Can someone help please

To get the latest date in ORACLE I use

GREATEST('01-Oct-2004','10-Oct-2004') and the result would be '10-Oct-2004' as this is the latest date of the two.

Any idea what the function is in MICROSOFT ACCESS ?

I've tried MAX(date1,date2) but that doesn't work.

Any help grateful
Thank you

Jon
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Are these two dates in the same field or different fields?

If they are the same field you could use totals and MAX to get the latest date.

If they are different fields you could use.

MaxDate:Iif([Date1]>[Date2], [Date1], [Date2])
 
Upvote 0
The dates are in different fields

I have done this

MaxDate : Iif(['10-Oct-2004'] > ['01-Oct-2004'], ['10-Oct-2004'], ['01-Oct-2004'])

and it doesn't seem to work.

Have I got it right at the beginning ??

Thanks for your reply

Jon
 
Upvote 0
Are the name of your fields 10-Oct 2004 and 01-Oct 2004?

[Date1] and [Date2] in my post where meant to represent fields.
 
Upvote 0
Yes - so it needs to be

MaxDate : Iif('10-Oct-2004' > '01-Oct-2004', '10-Oct-2004', '01-Oct-2004')

Correct ?

Thank you

Jon
 
Upvote 0
Sorry I still don't understand.

Are you actually comparing dates or two fields whose names are dates?

If the field names are the dates try this:

MaxDate : Iif([10-Oct-2004] > [01-Oct-2004], [10-Oct-2004], [01-Oct-2004])
 
Upvote 0

Forum statistics

Threads
1,221,821
Messages
6,162,157
Members
451,750
Latest member
pnkundalia

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