Link to home
Start Free TrialLog in
Avatar of turaks
turaksFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DATEDIFF RESULT IN VARIABLE AND USED IN SSRS EXPRESSION

Hello,

can someone please tell me how to put datediff results in a variable in a stored procedure and call it from an ssrs textbox .

e.g
1.  in stored procedure:

select,column1,column2 , salesprice,
@datediffresult = datediff(dd,date1,date2)  from table

2. in SSRS Expression
=sum(iif(@datediffresult >=1 and <=7), (Fields!salesprice.value)

I know that the above is not the right way to do it but does anyone have any idea how?  thanks
ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
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 turaks

ASKER

Thanks huslayer.  I have tried the datediff function in the expression but i have to do it for 12 textbox expressions such as:
12 11 10  9    8 7 6   5 4 3 2 1 0 -1  -2  -3  -4  -5   -6 -7 -8  -9  -10 -11 -12

Each number represents a textbox.  To use the datediff function in each textbox is taking to long to process.  

Please can you use an example of a computed column in the dataset?

Thanks
Hi,
Just right click on the dataset name and select add calculated field...
that would be your best bet.

 User generated image
Avatar of turaks

ASKER

Thanks. I will try this.
Avatar of Mike McCracken
Mike McCracken

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.