What Does =Now() Mean in an Microsoft Access Report?
Microsoft Access provides numerous built-in functions that calculate, analyze and display information. You can add a function to a report by using the "Text Box" tool and modify its format in the "Property Sheet." Or you can store a function as a field in your table and display it on your report. The Now function displays the date and time and is generally placed on a report as an unbound text box.
-
Syntax
-
The Now expression displays the date and time and is made up of several segments. The equals sign, function and parentheses are components of the syntax of the expression. Using correct syntax is critical because a database can only perform a function when instructed to with the correct combination of symbols. The completed function =Now() will update whenever the report is refreshed, creating a timestamp for reports.
Equals Sign
-
The equals sign in Microsoft Access signifies an expression. It works as a flag to alert Access that a function needs to be performed. Inputting the text "Now()" would simply display the words as written, but the addition of an equals sign results in the current date and time being displayed. If you set an expressions at the table level, it will display the product of that expression in queries, forms and reports.
-
Function
-
The Now function displays the current date and time based on your computer's settings. Microsoft Access has many built-in functions which you can use to calculate formulas, find information and convert data formatting. The Date function is similar to the Now function, except that it only displays the current date.
Parentheses
-
In Microsoft VBA, the parentheses after a function surround additional information about that field, including format. An easier way to change the format of a date and time field in a report is to select an option from the format drop-down box in the "Property Sheet" window. While the default format may be appropriate for some reports, you may want to change the formatting to reflect your needs. Your options range from short date to long time with many options between.
-
References
- Photo Credit Hemera Technologies/AbleStock.com/Getty Images