Create a new report following the instructions here only use the following SQL;
SELECT TO_DATE(:Data_Value)
FROM DUAL
FROM DUAL
This assumes you are using an Oracle database to connect to. It's possible that this could be just an Oracle issue but it's pretty unlikely.
Once the report is completed run it with the parameter '01-JAN-2070';
2070 Parameter Passed Through |
Now go into the properties of the Data_Value parameter and change the data type from Text to Date/Time;
Report Parameter Properties: Data type |
2070 Parameter Converted to 1970 |
In fact if you choose any date after 01-JAN-2050 then it will automatically revert to it's 1900's equivalent (31-DEC-2049 is ok).
Now you might be thinking that this is something specific to do with the way the machine I'm running on is configured so in order to do a quick test I've opened Outlook and created an appointment for 2070 which seems to work fine;
Microsoft Outlook: 2070 Appointment |
To further confirm it's an SSRS issue go back to the report and change the report title to display the parameter value;
Report Builder 3: Adding @Data_Value as the Report Title |
Report Builder 3: Date Confusion |
Go into the Query Parameters and change;
=Parameters!Data_Value.Value
To;
=Format(CDate(Parameters!Data_Value.Value), "dd-MMM-yyyy")
And now re-run the report;
Report Builder 3: Correct Date Values Displayed |
1 comment:
This was lovely to reaad
Post a Comment