Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 how do i write a nested case statement in my code

Author  Topic 

karenros
Starting Member

37 Posts

Posted - 2008-06-20 : 12:25:19
Hi,

I have around 10 pairs of Description and its and value. and i am trying to write a custom code in this fashion in SSRS



public function Format_ClosingBalance(PlatformId as integer,value8 as string, Totact8 as decimal, value10 as string,Totact10 as decimal) as decimal

dim i as decimal
If PlatformId = 1 Then
i = Totact8
Else
Select Case Value8
CASE "Closing Balance"
i = Totact8
Case value10
Case "Closing Balance"
i = Totact10
End Select

End if

Return i
end function







So i will be passing around 10 - 15 values in to that function and i checking if value field in them is equal to closing balance then i want to display its respect totact value.



any help will be appreciated..



thanks

Karen

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-20 : 13:04:29
The code looks ok. Are you getting any error?
Go to Top of Page

karenros
Starting Member

37 Posts

Posted - 2008-06-20 : 14:52:40
Thanks for you answer visakh.. it worked fine after i gave rtrim in the Fields!Columnname.value
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-20 : 15:00:47
quote:
Originally posted by karenros

Thanks for you answer visakh.. it worked fine after i gave rtrim in the Fields!Columnname.value


No worries. Feel free to post a question whenever you're in doubt.
Go to Top of Page
   

- Advertisement -