Link to home
Start Free TrialLog in
Avatar of thayduck
thayduckFlag for United States of America

asked on

SSRS 2008 Dataset Query Command Text Error

Below Query Command Text runs fine in SSRS Dataset to retrieve records. It retrieves data from a function with parameters.

SELECT DISTINCT
SubRegion
FROM WKLD.fnGetOEDGETransReportData(@FromDate,@ToDate,@FromHr,@ToHr,@FromMin,@ToMin,@Office,@Desk,@Shift,null)
ORDER BY 1

Now,  what I am trying to do is add a Where Clause so the query looks like this.

SELECT DISTINCT
SubRegion
FROM WKLD.fnGetOEDGETransReportData(@FromDate,@ToDate,@FromHr,@ToHr,@FromMin,@ToMin,@Office,@Desk,@Shift,null)
Where ActivityName = "TOP"
ORDER BY 1


But, I get the below error.

Invalid column name 'TOP'.

How can I include a Where Clause in this query or can it not be done.
I do not want to change the function since I did not write it unless I have to.
Just want to change this Query Command Text in the SSRS Dataset to include Where Clause.
ASKER CERTIFIED SOLUTION
Avatar of thayduck
thayduck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Manju
Top in your where clause should be in single quotes.

'Top'
Avatar of thayduck

ASKER

I tried it that way and it still failed.
I am going to close this question since I have a work around.
I figured out how to get it to work.