Hi,
I have a report and a list of products in a parameter field. I also need a
"All" option there, but have problems doing it...
the sql query is following
Select name, productid from filteredproduct where new_team_lty = @.team and
new_alkupaivamaara_lty between convert(smalldatetime, '1/1/' + @.year) and
convert(smalldatetime, '12/31/' + @.year)
union all
Select 'All', 'All'
This would work fine if there was only a name selected. But the productid is
uniqueidentifier type and I get a error message:
"An Error occurred while reading data from the query result set. Syntax
error converting from a character string to uniqueidentifier"
I understand what that means, but the problem is how can I avoid it? I can't
drop the productid out of the query and also need the 'All' option as well...
And I'm out of ideas how to have them both...
Thanks in advance!
RegardsWell...
The solution to this one was pretty simple after all...
CONVERT(varchar(255),productid) was the solution :)|||Ok,
problems again. That convert helped to make that one query to work, but in
the next query where I need that productid, it wont work anymore...
No comments:
Post a Comment