I am creating a report based on data from joint tables. Data in the report is filtered by Parameters - variable dates range which are passed from external application as a clarion date.
I would like to display on my report the values that were entered to parameters @date_from and @date_to in clarion date format but converted into date format.
The T-SQL code that converts the clarion date is:
cast ([date_from] - 36163 as datetime)
but when I use the above code it is displayed on report as text.
In Report Builder I understand an expression should do the conversion:
=CDate(Parameters!date_from.Value)
but that returns an #Error in the actual report.
What am I doing wrong?
******EDIT******
Correct syntax in Report Builder 3.0 for code Simon_Hou has supplied:
=DateAdd(DateInterval.Day, Parameters!date_from.Value, #12/28/1800#)
or =DateAdd(DateInterval.{Hour/Day/Month/etc.}, Int Value, #MM/DD/YYYY#)