Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I'm trying to modify the Custom Code below to identify all values equal too or less than '2', to be 'True' otherwise 'False'Public Function NotLike(ByVal val As String, ByVal filter As String)As BooleanIf val.Contains(filter) Then Return FalseElse Return TrueEnd IfEnd FunctionCalling with - =code.NotLike(ReportItems!DaysDiff.Value, “ld”)Thanks You!
gbritton
Master Smack Fu Yak Hacker
2780 Posts
Posted - 2014-11-24 : 11:18:30
Something like this (untested):
Public Function NotLike(ByVal val As String, ByVal filter As String)As BooleanIf val.Contains(filter) ThenReturn FalseEnd IfDim intVal as IntegerIf Not Integer.TryParse(val, intVal) Then Return FalseEnd IfIf IntVal <= 2 Then Return TrueEnd IfReturn FalseEnd Function
tech2
Yak Posting Veteran
51 Posts
Posted - 2014-11-24 : 12:29:50
Thanks for the reply.Unfortunately, the code is not working.I get a message 'End of statement expected'
gbritton
Master Smack Fu Yak Hacker
2780 Posts
Posted - 2014-11-24 : 20:38:40
Told you it was untested! However, I loaded the function into Visual Studio and it runs fine. So, it's not the function. Must be something else in your report. Or, you didn't copy the function exactly.