Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Converting dates in parameters

Author  Topic 

hambo12
Starting Member

7 Posts

Posted - 2009-06-28 : 20:33:57
I have managed to get a simple report from a Progress Openedge database connected to SQL reporting services.

The report uses an un-named parameter to select the date.
However, progress formats their dates as MM/dd/yyyy.
SQL reporting services parameter uses dd/MM/yyyy as the format to select the date. Therefore, the report returns an error when I select a date from the parameter calendar. This is the error:

An error occurred during local report processing.
The value provided for the report parameter 'Parameter1' is not valid for its type.


The only way I can get the report to work is to manually enter the date format in MM/dd/yyyy.

Is there any way to fix this issue? Can I change the format of the date when it is selected in the parameter?

hambo12
Starting Member

7 Posts

Posted - 2009-06-29 : 00:04:05
I have tried the following in the parameter tab in the dataset:

=format(Parameters!Parameter1.Value, "dd/MM/yyyy")

However when I try to run the report, I get this:

An error occurred during local report processing.
The value provided for the report parameter 'Parameter1' is not valid for its type.

I then try to change the parameter data type to "String" and re-run the report and enter the dd/MM/yyyy date. i get the following error:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt".

I can run the query in the Query analyser in the Data tab, and input the dd/MM/yyyy format, and the results display fine. However, when I run the report in the preview tab, the report fails.

Any ideas?
Go to Top of Page

Annakonda
Starting Member

17 Posts

Posted - 2009-07-10 : 08:55:37
Hi,

What is the parameter type exactly? String (precisely with slashes) or integer (and slashes are given for visual representation only)?

If String, try this:
=Left(Parameters!Parameter1.Value,2) & "/" & Left(Right(Parameters!Parameter1.Value,4),2) & "/" & Right(Parameters!Parameter1.Value,4)

If Integer, try this:
=Left(Parameters!Parameter1.Value,2)*1000000 + Left(Right(Parameters!Parameter1.Value,4),2)*10000 + Right(Parameters!Parameter1.Value,4)
Go to Top of Page

Annakonda
Starting Member

17 Posts

Posted - 2009-07-10 : 08:57:28
Oops,

4 should be 6 in Left(Right(Parameters!Parameter1.Value,4),2).
Go to Top of Page
   

- Advertisement -