Difference between revisions of "Accessing the Current Date in a Report"

From SmartWiki
Jump to: navigation, search
Line 32: Line 32:
  
 
{{PrevNextStart}} [[Using a Date Range in a Report]]
 
{{PrevNextStart}} [[Using a Date Range in a Report]]
{{PrevNextMid}} [[Creating Summary Reports]]
+
{{PrevNextMid}} [[Creating Summary Reports]] {{PrevNextEnd}}
{{PrevNextEnd}}
 
  
 
[[Category:Date Formats]]
 
[[Category:Date Formats]]

Revision as of 09:18, 19 September 2013

caption Click here to watch a video on SmartSimple's integrated reporting subsystem.

You will sometimes need to create reports that use the current year, month, or day. To build these types of criteria, you will need to use the Date/Time Translation setting, in conjunction with special criteria that retrieve the current date in a specified format.

1. Copy the report Employee Start Dates to a new report Employee Start Dates - Current Year.

Reps58.png

2. Display the Report Builder.

3. Click the Date Comparisons tab in the bottom half of the window.

Reps59.png

These expressions are used in the criteria to automatically display dates

These functions are used to extract specific types of times from a date field. For example, the current year.

4. Modify the Date Criteria to look as follows:

Reps60.png

5. Build, save, and preview the report.

No records will be displayed as no employee was hired in the current year.

In order to return only records from today's date, enter the following MySQL command into the criteria field: =curdate(), as follows:

Todaysdateinreportbuilder.jpg




Previous.png Using a Date Range in a Report Creating Summary Reports Next.png