The following table lists examples of expressions that use the Format function to calculate when a day, week, or month falls in a given time period.
You can use these expressions in calculated controls (calculated control: A control that is used on a form, report, or data access page to display the result of an expression. The result is recalculated each time there is a change in any of the values on which the expression is based.) on forms, reports, and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.).
| Expression |
Description |
| =Format(Now(), "ww") |
Displays the number of the week of the year the current date represents, where ww is 1 through 53. |
| =Format(Now(), "y") |
Displays the number of the day of the year the current date represents, where y is 1 through 366. |
| =Format(Now(), "mmm") |
Displays the abbreviated month the current date represents, where mmm is Jan through Dec. |
You can use these expressions in a calculated field in a query.
| Expression |
Description |
| MyTurn: Format(Now(), "y") |
Displays in the MyTurn field the number of the day of the year the current date represents, where y is 1 through 366. |
| ThisMonth: Format(Now(), "mmm") |
Displays in the ThisMonth field the abbreviated month the current date represents, where mmm is Jan through Dec. |