all groups > sql server reporting services > june 2006 >
You're in the

sql server reporting services

group:

Ignores date parameters



Ignores date parameters Benw
6/2/2006 11:15:02 AM
sql server reporting services: I have a report with a beginning date and ending date. I want all the data
between those dates. It is set to datetime in the parameters and runs just
fine except it totally ignores my dates. It gives me just about everything.
Re: Ignores date parameters Benw
6/2/2006 11:31:02 AM
oh sorry.
SELECT MSP_PROJECTS.PROJ_ID, MSP_PROJECTS.PROJ_NAME, MSP_TASKS.TASK_ID,
MSP_TASKS.TASK_IS_SUMMARY, MSP_TASKS.TASK_START_DATE,
MSP_TASKS.TASK_FINISH_DATE, MSP_TASKS.TASK_NAME,
MSP_TASKS.TASK_PCT_COMP
FROM MSP_PROJECTS INNER JOIN
MSP_TASKS ON MSP_PROJECTS.PROJ_ID = MSP_TASKS.PROJ_ID
WHERE (MSP_TASKS.TASK_NAME LIKE ' %' + @cabinets + '%') OR
(MSP_TASKS.TASK_NAME LIKE @deliver + '%') OR
(MSP_TASKS.TASK_NAME = @shower) OR
(MSP_TASKS.TASK_NAME = @hardware) OR
(MSP_TASKS.TASK_NAME = @carpet) AND
(MSP_TASKS.TASK_START_DATE BETWEEN @startdate AND @endate)
[quoted text, click to view]
Re: Ignores date parameters Benw
6/2/2006 11:55:01 AM
That worked great, thank you very much

[quoted text, click to view]
Re: Ignores date parameters Benw
6/2/2006 12:04:02 PM
Also how do I get information to pull that is equal to the endate. It only
pulls info from the start date to the day before the endate.

[quoted text, click to view]
Re: Ignores date parameters Benw
6/2/2006 12:08:01 PM
nevermind, i just added 1 to the enddate parameter with the datedd function

[quoted text, click to view]
Re: Ignores date parameters Bruce L-C [MVP]
6/2/2006 1:19:11 PM
Can you post the query?

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Ignores date parameters Bruce L-C [MVP]
6/2/2006 1:46:30 PM
Try this. Note I'm bracketing all the ORs together and then doing the AND.
See how this works for you.

WHERE ( (MSP_TASKS.TASK_NAME LIKE ' %' + @cabinets + '%') OR
(MSP_TASKS.TASK_NAME LIKE @deliver + '%') OR
(MSP_TASKS.TASK_NAME = @shower) OR
(MSP_TASKS.TASK_NAME = @hardware) OR
(MSP_TASKS.TASK_NAME = @carpet)) AND
(MSP_TASKS.TASK_START_DATE BETWEEN @startdate AND @endate)


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

AddThis Social Bookmark Button