SSRS 2008 R2 reports Date Prompt is not filtering data
SET @StartDate = ('2012-01-01'), @EndDate = ('2012-02-15');SELECT start_date, due_date, fixed_version_id, tracker_id, priority_id, COUNT(issues.id)FROM issuesWhere start_date BETWEEN @StartDate AND @EndDate;
The above query I am using in MySQL, its giving me right results. Now I am using same query like below to build report in SSRS 2008 r2.
SELECT start_date, due_date, fixed_version_id, tracker_id, priority_id, COUNT(issues.id) FROM issues Where start_date BETWEEN @StartDate AND @EndDate
In Report parameter properties data type is Date/Time.
then in Dataset properties parameters I changed using below Expression
=Format(Parameters!StartDate.Value, "yyyy-MM-dd") and =Format(Parameters!EndDate.Value, "yyyy-MM-dd") So Now when I run report prompts are working fine but report is empty. Not showing COUNT values. IF I use below query for reporting with out date prompt
its working fine.
SELECT start_date, due_date, fixed_version_id, tracker_id, priority_id, COUNT(issues.id) FROM issues Where start_date BETWEEN '2012-01-01' AND '2012-02-15'
Please suggest any one,How can I resolve this.
Thanks & Regards
Parandam
February 20th, 2012 3:00am
can you also edit your Start_Date format to same in the where cluase please
It may helps
Free Windows Admin Tool Kit Click here and download it now
February 20th, 2012 5:47am
DATE_Format(start_date,'%m/%d/%Y %r') IN MySQL I did that also but no use. But I am using SQL Server Evaluation Version. This may be reason ????
Thanks & Regards
Parandam
February 20th, 2012 6:23am
Hi Parandam,
In your case, this issue might be caused that add an invalid filter on the dataset. Please refer to the following example to add the filter:
Expression: =Format(Fields!DateTime.Value, yyyy-MM-dd)
Operator: Between
Value: =Format(Parameters!StartDate.Value, "yyyy-MM-dd"); =Format(Parameters!EndDate.Value, "yyyy-MM-dd")
If you have any more questions, please feel free to let me know.
Thanks,
Bin LongBin Long
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2012 3:08am
Hi Bin Long,
Thank you, I used above Date Format, but it dint work in my case. I am using
Mysql Database, connected using ODBC. I came to know that ODBC does not allow named parameters. I managed to get around this by simply using like below query:
SELECT start_date, due_date, fixed_version_id, tracker_id, priority_id, COUNT(issues.id) FROM issues Where start_date BETWEEN (?) AND (?);
The above query is a sample. This query gives me two parameters in SSRS, named
paramere1 and parameter2.So now I renamed this two in SSRS
StartDate and EndDate data type Date/Time. Now it is working fine.
Thanks & Regards
Parandama
Thanks & Regards Parandam
February 22nd, 2012 4:27am
Hi Parandam,
Thanks for your reply and glad to hear this issue has been sovled. It will benefit other community members who have the similar issue with you.
Have a nice day!
Thanks,
Bin LongBin Long
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2012 4:36am