The SSRS DateString function is a Date and Time function that returns the string representation of the current local date according to your system. The syntax of the DateString function to print the current date as the string data type is as shown below.
=DateString()
To demonstrate the SSRS DateString function, we use the Employee table below, which has 15 records. The image shows the records in the Table report.
SSRS DateString function Example
For this, let me add a new column to the right side of the Hire Date column and name it the DateString. Next, right-click the textbox under DateString and choose Expression. To understand the report, I suggest you refer to the articles on charts, tables, grouping, and format tables in SSRS.
It opens the following expression window to print the present date. The below SSRS DateString function prints the current local date as per the system in a string format.
=DateString()
Apart from the above, you can use the DateAdd, DateDiff, or DatePart functions to add, delete, and extract parts of the current date. To demonstrate this, add a new column, Diff, and write the expression below. It will find the difference in years between the Hire Date column and the current system date.
=DateDiff("yyyy", Fields!HireDate.Value, DateString())
Please click the preview tab to see the report. For more functions >> Click Here!