If, on the other hand, you need to do that with large loads of specified dates, then it might be worth to sort your date array once and then implement a binary search algorithm.
In reply to Re: choosing closest date to a given date
by Laurent_R
in thread choosing closest date to a given date
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |