function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
I need to find maximum date and minimum date from a list of dates.Can anyone give me solution??
Regards,
banu
Well I am not sure how accurately 'sort' method would work, you would have to check it out by yourself. But if it does.
then suppose your list of date is 'datelist' then
datelist = datelist.sort();
date minDate = datelist.get(0);
date maxDate = datelist.get(datelist.size()-1);
would provide you with minimum and maximum date.
Simply do a 'sort' on the list of dates. Fetch the first element then, it will be the mimimum one.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_list.htm , look for sort.
Hope this helps.
Well I am not sure how accurately 'sort' method would work, you would have to check it out by yourself. But if it does.
then suppose your list of date is 'datelist' then
datelist = datelist.sort();
date minDate = datelist.get(0);
date maxDate = datelist.get(datelist.size()-1);
would provide you with minimum and maximum date.
All Answers
Hi,
Simply do a 'sort' on the list of dates. Fetch the first element then, it will be the mimimum one.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_list.htm , look for sort.
Hope this helps.
Well I am not sure how accurately 'sort' method would work, you would have to check it out by yourself. But if it does.
then suppose your list of date is 'datelist' then
datelist = datelist.sort();
date minDate = datelist.get(0);
date maxDate = datelist.get(datelist.size()-1);
would provide you with minimum and maximum date.