all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

Help with parameter


Help with parameter Tango
8/24/2005 4:49:02 PM
sql server reporting services:
Hi,
I am querying a sybase database for my table & need to add a start date &
end date to the query.
my where statement looks like this
WHERE (ACDCallDetail.CallStartDt>={ts '2005-08-09 08:00:00'} AND
ACDCallDetail.CallStartDt<{ts '2005-08-09 20:00:01'})

can i please have some assistance around inserting the parameters start_date
& end_date

i have tried

WHERE (ACDCallDetail.CallStartDt>=:start_date AND
ACDCallDetail.CallStartDt<:end_date) and also WHERE
(ACDCallDetail.CallStartDt>=@start_date AND
ACDCallDetail.CallStartDt<@end_date) to no avaial.

i also need to have the query that extracts the month only (for a month to
date) out of say the start_date & the end_date (for month to date figures)

Thankyou in adavance for any help

Re: Help with parameter Derrick Van Hoeter
8/24/2005 8:38:24 PM
What happens when you use

WHERE ACDCallDetail.CallStartDt >= @start_date
AND ACDCallDetail.CallStartDt < @end_date

?

Derrick


[quoted text, click to view]

Re: Help with parameter Tango
8/24/2005 8:45:04 PM
The parameters box comes up & i enter dates (tried both 01/08/2005 or
01/08/2005 12:00 AM) & i get following error message

must declare variable '@start_date'

Thanks

Todd

[quoted text, click to view]
Re: Help with parameter Derrick Van Hoeter
8/25/2005 5:43:48 AM
Todd,

In what environment are you running the query?

Derrick

[quoted text, click to view]

Re: Help with parameter Wayne Snyder
8/25/2005 1:38:30 PM
Use
WHERE
(ACDCallDetail.CallStartDt>=@start_date AND
ACDCallDetail.CallStartDt<@end_date)

You must add parameters to the report Called start_date and end_date ( use
the same case as the where clause)
Then open the data set and check the Parameters tab to ensure there is a
mapping between the parameter and the variable..

To get a month value from a date in SQL

select Datepart(mm,Getdate())

This returns the number of the month...

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

Re: Help with parameter Tango
8/25/2005 8:25:35 PM
Thanks Guys

I am using the where statement as suggested, the 2 parameters in the report.
Still doesnt work.
when i run the query in generic query designer, i get asked for parameters
where i have tried entering date format dd/mm/yyyy 12:00 AM or just
dd/mm/yyyy. I have also tried changing the parameter type from datetime to
string & i get the following message
Error [HY000] [DataDirect] [ODBC Sybase Driver][SQL Server] Must declare
variable '@start_date'.
Its no use using the sql query designer as the system just locks up when i
have dates pre coded or gives error message when i attempt to run the query
"Providor can not derive parameter information and setparameterinfo has not
been called"

Look forward to hearing from you.
Todd
Im not sure if this means anything but i am querying a sybase database via
an ODBC (type) datasource.


[quoted text, click to view]
Re: Help with parameter Derrick Van Hoeter
8/26/2005 6:31:11 PM
Todd,

I have received the same error message before when I have changed the query
around the parameters. I don't have Reporting Service installed on this
machine so I'm going from memory, but in the generic query design pane,
there is a button to refresh data. Find that button and refresh the data,
then try to run the query with the parameters again. You may still get an
error but it should be a different error.

Let me know how it goes.

Derrick


[quoted text, click to view]

Re: Help with parameter Tango
8/28/2005 5:47:02 PM
Thanks for your interest Derrick & Tom,

in generic query designer the error message after entering dates is 'must
declare variable '@start''.

when i refresh the pane i get error message That data extension odbc does
not support named paramters. use unnmaed paramaters instaed.
Todd

[quoted text, click to view]
AddThis Social Bookmark Button