April 20, 2009 at 4:14 pm
have a table in a report that I need to only print if MyDate is within the last 3 years. I have tried several things and I either get all dates or none.
I have tried the following that returns no dates:
Table Properties, Filters
Expression Operator Value
=CDate(Fields!MyDate.Value).ToShortDateString > CDate (DateAdd(DateInterval.year, -3,now).ToShortDateString)
Example:
MyDate
20060101 ----Do not want this
20070403 ----Want to see this
20080420 ----Want to see this
20040420 ----Do not want this
Changinagain
April 21, 2009 at 7:10 am
I would think you would want to filter that in your SQL Statement so you are not bring all the data across the wire and then filtering it. I mean this is what SQL Server is best at.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 21, 2009 at 7:23 am
That is what I would normally do but for this report I am using a Data Viewer Web Part and Web Site Data Sources so I am not actually writing a query for the data. Not by my design but that is what I have to work with.
Changinagain
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply