Get the Current Day of the Week

The day of the week can be calculated by using two Formula Language functions@Weekday and @Select (e.g., Sunday through Saturday).

How It Works

The @Weekday function returns a numeric value between one and seven, corresponding to the day of the week. The function returns a numeric one for Sunday and continues through Saturday, which returns a numeric seven. When combined with the @Select statement, the corresponding text value (or day of the week) is stored in the Result.


To implement this solution, insert the following formula in an action button, column, or default value for a field. Optionally, replace @Today with a date or field. The @Prompt statement is used for illustrative purposes and can be removed or updated as desired. However, if removed, be sure the formula contains a main expression (i.e., Result) as the last statement in the formula.

result := @Select( @Weekday ( @Today);
@Prompt([Ok];"Day of week"; result)

Figure 14.3 depicts the result when the button is pressed on a Tuesday.

Figure 14.3. Example day of the week


Using the @Today and @Now functions in column formulas will result in the refresh icon being permanently displayed on the view. Where possible, dates should be stored in a document field that is referenced in the column formula.

Lotus Notes Developer's Toolbox(c) Tips for Rapid and Successful Deployment
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
ISBN: 0132214482
EAN: 2147483647
Year: N/A
Pages: 293
Authors: Mark Elliott
Simiral book on Amazon © 2008-2017.
If you may any questions please contact us: