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
 Development Tools
 Reporting Services Development
 Between Function

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2009-09-07 : 10:24:42
Hi Guys

When building an expression is there anyway to use BETWEEN type function.

For example in SQL you could do

SELECT *
FROM Persons
WHERE DateOfBirth BETWEEN @StartDate and @EndDate

Is this achievable? Reason I am asking is because I need to produce a report with condition formating, i.e. if the value of the cell is between the @StartDate and @EndDate values then coulour the cell yellow.

I hope this makes sense.

Thanks

yavvie
Starting Member

46 Posts

Posted - 2009-09-08 : 03:58:52
not sure about between, but you can surely use > and <

so in your background color expression you would have

=IIF(DateOfBirth > @StartDate AND DateOfBirth < @EndDate, "yellow", "black")
Go to Top of Page

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2009-09-11 : 04:27:50
Hey

Thanks for that, worked great!
Go to Top of Page
   

- Advertisement -