Groups | Blog | Home
all groups > sql server reporting services > august 2006 >

sql server reporting services : Data tab works great but i can't get it work in Preview tab in reporting services


Dre
8/15/2006 10:02:31 AM
This code works great in data tab but when i go to preview it i get a len function error.
I am passing possible BLANK values in all the strings not NULL. Do you think its an parameter expression issue? If so, how do I write a expression for each parameter that will reflect this logic. NOTE: As you can see states and program are multi param, and I don't know ahead of time what values will be entered. So if some could please help.

SELECT DISTINCT A.RECIPIENT_STATE, B.FISCAL_YEAR, B.FEDERAL_SHARE, B.NON_FEDERAL_SHARE
FROM Tab_Awards AS A JOIN TAB_Amendments AS B ON A.AWARD_NUMBER = B.AWARD_NUMBER JOIN Tab_Program AS C
ON A.FPO_ID = C.FPO_ID
WHERE (LEN(@keywords)<1 OR (FREETEXT(A.*,@keywords)))
AND (LEN(@states)<1 OR A.RECIPIENT_STATE IN (@states))
AND (LEN(@program) <1 OR C.PROGRAM IN (@program))
AND (LEN(@fromYear)<1 OR B.FISCAL_YEAR >= @fromYear)
AND (LEN(@toYear)<1 OR B.FISCAL_YEAR <= @toYear)
AND (LEN(@year)<1 OR LEN(@year)>=1)
AND (LEN(@organization)<1 OR LEN(@organization)>=1)

From http://www.developmentnow.com/g/115_0_0_0_0_0/sql-server-reporting-services.htm

Posted via DevelopmentNow.com Groups
Amarnath
8/15/2006 11:20:02 PM
What exactly is the error ? Why I am asking is that len must be evaluating
some numeric value e.g year parameter must be having numeric and Len will
take string expression only. So Just have a look at all the parameters again
and see their data type.

Amarnath


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