Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Select a rate from a rates table

Avatar of Ausway
AuswayFlag for Australia asked on
Microsoft SQL ServerMicrosoft SQL Server 2005SSRS
11 Comments1 Solution451 ViewsLast Modified:
Hi Experts,
 
I am trying to select a rate from a rates table for a particular employee using a combination of Employee and ValidFrom to narrow down the rate.
 
Employee    ValidFrom               Rate
ABC               11-08-2009              100
ABC               22-05-2010              120
 
The report passes a ToDate and FromDate parameter to the stored proc that I can reuse for the ValidFrom hence
 
when I run the report for period 01-05-2010 to 07-05-2010 I do not get any rate as there is no
ValidFrom between 01-05-2010 to 07-05-2010.
 
For the period between 01-05-2010 to 07-05-2010 I need
ABC               11-08-2009              100
 
For the period between 01-06-2010 to 07-06-2010 I need
ABC               22-05-2010              120
 
What would be the best approach to tackle this?
 
Many thanks in anticipation.