Date Table,Calendar.FIND(SearchString)

Hi friends,
recently I was going through FindDate function in Codeunit 359, PeriodFormManagement. Here got a line,
Found := Calendar.FIND(SearchString);
and value of SearchString is ‘=<>’ to find the record and I don’t know what does it mean. Do anyone know how to use this kind of value to find 1st day of current week?
Please help. Thanks in advance.

You can use CALCDATE function.

http://msdn.microsoft.com/en-us/library/dd301368.aspx

Calendar.FIND(’=<>’) means “find the record that exactly (=) matches the primary key-fields in Calendar”; if not found, then “find the nearest record, before (<), to primary key-fields in Calendar”; if not found, then “find the nearest record, after (>), to primary key-fields in Calendar”.

The first day of this week? “CALCDATE(’-CW’, TODAY);”

Always better to use <> in Dateexpession

“CALCDATE(‘<-CW>’, TODAY);”

For example, if a user with language set to ENG (English) enters the date formula “1W+1D” for one week and one day, then a user with the language set to FRA (French) sees “1S+1J,” and a user with the language set to ESP (Spanish) sees “1S+1D”.

If a date formula is entered with < > delimiters surrounding it, then the date formula is stored in a generic, nonlanguage-dependent format. This makes it possible to develop date formulas that are not dependent on the currently selected language.

Correct :slight_smile:

Actually I too have the same doubt…

Thank you guys…