Solved

SSRS - Applying multiple Parameters (date) to Reports

Posted on 2008-06-15
11
1,609 Views
Last Modified: 2010-08-05
I am trying to create a report that takes Product Name & the start and the end date as a parameter...

Product name apply parameters @ report level...
Start and the end date apply parameters @ query level

The problem is that when I select date from the report, it changes the value (replaces Month with the date) before applying query

as an example... when I selected May 1, 2008 from the calender... it got changed to Jan 5, 2008 before running the query...

in my data set, I am using following parameters:

WHERE    
      convert(datetime,trans_dt,103)  BETWEEN convert(datetime,@FROM_DATE,103) and convert(datetime,@TO_DATE, 103)

in report parameters, I ve used dateTime as the data type...

Please advice

0
Comment
Question by:redgreenred
  • 6
  • 5
11 Comments
 
LVL 13

Expert Comment

by:rickchild
ID: 21791609
Are you running the query directly in the data set, or passing those dates to a Stored Procedure?

Where are you based, Convert 103 is British/French date, have you tried without the convert as it should try to match your server environment?  Could explain why the day and month is backwards as these would be reversed in British.  Still strange as you are converting both sides to get consistency.

Maybe try converting as type 121 is this is a more generic format yyyy-mm-dd hh:mi:ss.mmm
0
 

Author Comment

by:redgreenred
ID: 21793791
I am running the query directly in the data set

.   Passing one report parameter... which is working fine
.   Passing two parameters (start and the end dates) to the query in data set... This is where I am facing problems...

I've converted to type 121 but issue remains the same:

WHEN I SELECT DATES FROM THE CALENDER, DAY AND MONTH GET SWITCHED... BUT WHEN I APPLY THE FOLLOWING FOMAT MANNUALLY IT WORKS FINE (DD/MM/YYY)

Please advice...

Thanks
0
 
LVL 13

Accepted Solution

by:
rickchild earned 100 total points
ID: 21794059
Have you deployed the report to the server yet, or are you still in Visual Studio developing the report?

I have solved a similar problem in the past by deploying the report, as this enables it to pick up the Regional information from the server.

I would try deploying what you have done so far, and then trying to run it from the server.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

Author Comment

by:redgreenred
ID: 21794418
I haven't deployed it to the server yet,... still using BIDS...

Thanks
0
 
LVL 13

Expert Comment

by:rickchild
ID: 21801591
OK, might be worth deploying the report as it stands, and then you may have more luck
0
 

Author Comment

by:redgreenred
ID: 21816128
I've deployed it to the server

Good news: It's working fine for me

Challenge: other users are getting an error message when they select dates from the calender or enter dates in the format (mm/dd/YYY)

here is the message that they are getting:

The value provided for the report parameter 'FROM_DATE' is not valid for its type. (rsReportParameterTypeMismatch)

but when they change the format to dd/mm/yyy it works for them too...

Please advice...
0
 

Author Comment

by:redgreenred
ID: 21816143
I am using following to filter in the dataset query

trans_dt  BETWEEN convert(datetime,@FROM_DATE,121) and convert(datetime,@TO_DATE, 121)

Thanks
0
 
LVL 13

Expert Comment

by:rickchild
ID: 21820414
OK, a bit closer anyway. Does it now work for you from both BIDS and the server?

This is likely down to a regional setting in the Users internet browsers, which means the default date sent is in the format mm/dd/YYYY, and this is used in the calendar too as it's the default.
It sounds like the users are set up for US, but the report server is expecting a British/European date?

Or I guess it could be the conversion, but I think you would get a different error in that case.


Steps to Reproduce:

1.) Create a report with a date time parameter. Set the initial value to =Today()
2.) Configure the Internet Explorer Language Settings to default US
3.) Open the Report through the Report Viewer (http://servername:port/reportserver)
4.) Change the date value through the date time picker

See if this reproduces (rsReportParameterTypeMismatch), and then try with British default on the browser.
0
 

Author Comment

by:redgreenred
ID: 21825611
it worked on the server
0
 
LVL 13

Expert Comment

by:rickchild
ID: 21826462
OK great, I have been caught out by this one before, and worked on it all day before deploying it on the server!
0
 

Author Comment

by:redgreenred
ID: 21827110
Thanks again
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Merige returns error code when updating 15 57
CROSS APPLY 4 61
Getting max record but maybe not use Group BY 2 36
Email Notifications for SQL 2005 9 37
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question