O
okelly
Hi All
I'm trying to query a string containing a list of operating systems
types and return the operating system family to me. eg "Windows NT" is
a member of "Windows" etc.
The code below returms the correct result only when the string EXACTLY
matches the code syntax, (including whitespaces, gaps, punctuation
etc...)
What syntax do I use if the string CONTAINS the pVal? I've tried
"If pVal Like "Windows NT" Then...etc.. but it's not working..
I need something like "If pVAl contains "Windows" then Operating System
= "Windows"
Thanks
Conor
Code:
--------------------
Function OperatingSystem(pVal As String) As String
If pVal = "Windows 2000 Server SP4" Then
OperatingSystem = "Windows"
ElseIf pVal = "Windows NT" Then
OperatingSystem = "Windows"
Else
OperatingSystem = "Other"
End If
End Function
I'm trying to query a string containing a list of operating systems
types and return the operating system family to me. eg "Windows NT" is
a member of "Windows" etc.
The code below returms the correct result only when the string EXACTLY
matches the code syntax, (including whitespaces, gaps, punctuation
etc...)
What syntax do I use if the string CONTAINS the pVal? I've tried
"If pVal Like "Windows NT" Then...etc.. but it's not working..
I need something like "If pVAl contains "Windows" then Operating System
= "Windows"
Thanks
Conor
Code:
--------------------
Function OperatingSystem(pVal As String) As String
If pVal = "Windows 2000 Server SP4" Then
OperatingSystem = "Windows"
ElseIf pVal = "Windows NT" Then
OperatingSystem = "Windows"
Else
OperatingSystem = "Other"
End If
End Function