Solved

sql ssrs parameters

Posted on 2008-10-12
3
193 Views
Last Modified: 2012-05-05
I have a dataset with columns names like projectname,startdate,enddate,client name,resources,status etc.
I am making projectname,startdate,enddate as parameters for my report.when i go and preview my report
and select startdate and enddate i am able to get data only if  i pass the exact dates for that particular project,but i wanted to get data for all the projects that started  between the start and enddates.I have attached a screen shot.I wanted to know how to  write a query to return the data between those two parameter dates

ques.doc
0
Comment
Question by:srirama_rao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:srirama_rao
ID: 22700276
Hi,
  My only problem is i got to retrieve all data which falls between  startdate and enddate parameters.
Right now if i run my report i am able to get data that exactly matches startdate and enddate in my database
which is not what i wanted.Any help is appreciated.
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22704312
In your query, which should be a stored procedure, you just pass in @startDate and @EndDate and then do your logic in your where clause



where ((@StartDate between startDate and enddate)
       or (@endDate between startdate and enddate))


This will allow you to find items that overlap with either date.
0
 

Author Comment

by:srirama_rao
ID: 22708937
Hi Brandon,
    Thanks for your help.This where clause is not fetching me right records(i mean all the project names that falls between the start and end dates).It is getting all the records that are out the date range also.I am attaching a screen shot pls look at the dates(which are  out of range)
ques.doc
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Inserting a column in a table that creates an ID and row number 4 76
Help  needed 3 52
Query group by data in SQL Server - cursor? 3 86
What is this datetime? 1 33
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question