May 31, 2012 at 9:37 am
Hi everyone
I would like my report to only show data for a particular range of dates. When I use the Filters in Tablix Proprties I am not able to create a between Date1 and Date2 filter as required. It doesn't seem to recognise >/=/< symbols or more likely I'm not using them appropriately.
Anyone shed any light on what I should be doing...
Thanks in advance.
BO
January 14, 2015 at 9:40 pm
Hi
I had a similar query and was dismayed that you got no assistance!
January 15, 2015 at 1:34 am
anthony.rooney (1/14/2015)
HiI had a similar query and was dismayed that you got no assistance!
Try filtering in the data set itself. What is your source?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 15, 2015 at 2:31 am
What version of SSRS?
On 2012 there is a Between operator, and (I don't have access to check earlier versions) if that is missing, then two filters, one > = and one < should do it.
Make sure your dates are really dates though and not strings!
Edit: Attached Sample Report
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
January 15, 2015 at 3:35 pm
Hi
I tried using the DateDiff function but struggled with the syntax. I would be great if the stairway had some examples. I also tried using DateDiff in a SQL Computed Column directly in a SQL table and finally got it to accept the following syntax DateDiff(D,[Need Date],[Date Identified]) but to my surprise SQL would not allow me to save the table telling me I had to drop the table first at which point I gave up. I am amazed it is so hard to get the number of days between two dates returned as an integer when both fields are date format.
I was trying to follow this example:
http://www.blackwasp.co.uk/SQLComputedColumns.aspx
It would be really helpful if more information and assistance was provided about how to use Tablix Filters with practicle examples. Another good candidate for a sample would be how to return only records that have value in a specific field - i.e. if field Department is blank do not return this record.
I was not able to get IsBlank to work in this filter.
January 16, 2015 at 12:37 am
It seems strange to me that adding a column would cause the table to be dropped. Did you use the ALTER TABLE statement?
In my opinion, the blank column issue could easily be implemented in the WHERE clause of the data set: WHERE column IS NOT NULL AND column <> ''.
In the following tip filters are described:
Dataset and tablix filtering in SQL Server Reporting Services[/url]
I can clearly see the operator <> in the list, so I would assume you could filter on column <> "".
(I also see the between operator, to answer your earlier question)
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 18, 2015 at 5:38 pm
I agree Koen it seems strange to require that the table be dropped and I found no advise if this requirement in the many articles I reviewed on how to create Computed Columns.
I was able to resolve the problem by removing the check box "prevent saving changes that require Table re-creation" which appears to be on by default. I found this option in SQL Management Studio - Tools - Options - Designers - Table Options.
Not sure why there is no advice published on this requirement if this is what you need to do to make it work using SQL Management Studio.
January 18, 2015 at 11:15 pm
Koen Verbeeck (1/16/2015)
It seems strange to me that adding a column would cause the table to be dropped. Did you use the ALTER TABLE statement?In my opinion, the blank column issue could easily be implemented in the WHERE clause of the data set: WHERE column IS NOT NULL AND column <> ''.
In the following tip filters are described:
Dataset and tablix filtering in SQL Server Reporting Services[/url]
I can clearly see the operator <> in the list, so I would assume you could filter on column <> "".
(I also see the between operator, to answer your earlier question)
I understand the logic of what you are saying Koen however I am as a learner trying to apply this to the layout of the UI as presented. In the DataSet properties Filters UI I have Expression where I have chosen the field I want to test, which evaluates to =Fields!fieldname.value. In Operator I selected "<>" and in the value section "Null". i don't see where to select the WHERE column as you have written it with the UI as presented.
My question was basically how do you use the DataSet Properties Filters UI?
When I preview the report I get no errors but the report is returning the blank records as well as those which test field is not null so no filtering is applied.
January 19, 2015 at 12:10 am
The WHERE clause is for the SQL statement in the data set 🙂
Instead of using NULL in the filter, use "Nothing" instead.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 19, 2015 at 3:10 pm
Fine, but how do you get to edit the SQL query using the interface provided?
In the DataSet propertiesi have a query option however I can do nothing here except Refresh Fields?
January 19, 2015 at 3:15 pm
In the data set, the option query type must be set to Text.
Then click Query Designer, which will open the query editor, where you can edit the text.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 19, 2015 at 4:31 pm
Wow I stumbled on the realisation that I can indeed see the underlying SQL query associated with the DataSet if I select the rsd file in Solution Explorer. I wasted a lot of time searching through all the menues of Visual Studio DT 2013 because of this massive UI design flaw. Why can you not get to the properties of the DataSet query from the query tab of the Report Data tool?
This is precisely why for those learning these new data tools, changed substantially from BIDS, learners need guidance on how to navigate such a confusing and somewhat convoluted interface.
I'm not clear where logically the Report Data applet fits with Solution Explorer and why the DataSet property boxes should be so different. Expert users will not have these problems however the stairways are designed for learners.
January 19, 2015 at 6:32 pm
Hello
Here is what appears to filter as expected.
In DataSet properties Filter I added in the Expression field =IsNothing(Fields!myField.Value)<>TRUE. Changed type to Boolean, Operator to "=" and Value =true.
Remarkabily with this in place and returning the correct records if I double click the Solution Explorer representation of the Shared DataSet the filter section shows no filter but it can be reviewed DataSet properties section of the Report Data applet. An interface designed to confuse could not be better constructed and it took a real long time to achieve this simple filter. I hope these observations help others.
January 20, 2015 at 12:49 am
anthony.rooney (1/19/2015)
HelloHere is what appears to filter as expected.
In DataSet properties Filter I added in the Expression field =IsNothing(Fields!myField.Value)<>TRUE. Changed type to Boolean, Operator to "=" and Value =true.
Remarkabily with this in place and returning the correct records if I double click the Solution Explorer representation of the Shared DataSet the filter section shows no filter but it can be reviewed DataSet properties section of the Report Data applet. An interface designed to confuse could not be better constructed and it took a real long time to achieve this simple filter. I hope these observations help others.
Yeah, SSRS is not really a beacon of usability.
With shared datasets, you have to look at the data set in solution explorer, not really the data set stub in the report itself.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
January 20, 2015 at 3:53 pm
Hi Koen
I appreciate your assistance which has been very helpful.
I think it has something to do with the ability to set filters at DataSet, Report and perhaps Tablix level too based on how you interpret the documentation. It would indeed be helpful if Microsoft put better titles in the title area of the respective applets and even sytled them modestly differently to help people understand their operational context.
The changes in layout from BIDS have not been an improvement for those learning.
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply