M
Mark K
I'm trying to create a function to use in a query
expression that will go through a field list to break down
a string in order to retrieve the common suffixes of the
string.
Here is an example string list:
IGS-NASFRONTED
NAS-FRONTEND
IGS-NASBACKEND
NAS-BACKEND
IGS-NASFINANCE
NAS-FINANCE
My desire result would be:
FRONTEND
FRONTEND
BACKEND
BACKEND
FINANCE
FINANCE
Here is what I have so far but it will give me a compile
error.
Function newBucket(StrGroupID As String) As String
Dim StrCutPrefix As String
Dim StrTemp As String
Dim StrBucket As String
If IsNull(StrGroupID) Then
StrBucket = ""
Exit Function
End If
StrCutPrefix = Mid(StrGroupID, 5)
StrTemp = Left(StrCutPrefix, 3)
If StrTemp = "NAS" Then
StrBucket = Mid(StrCutPrefix, 4)
Else
StrBucket = StrCutPrefix
End If
newBucket = StrBucket
End Function
Any help will be greatly appreciated. Thank You.
expression that will go through a field list to break down
a string in order to retrieve the common suffixes of the
string.
Here is an example string list:
IGS-NASFRONTED
NAS-FRONTEND
IGS-NASBACKEND
NAS-BACKEND
IGS-NASFINANCE
NAS-FINANCE
My desire result would be:
FRONTEND
FRONTEND
BACKEND
BACKEND
FINANCE
FINANCE
Here is what I have so far but it will give me a compile
error.
Function newBucket(StrGroupID As String) As String
Dim StrCutPrefix As String
Dim StrTemp As String
Dim StrBucket As String
If IsNull(StrGroupID) Then
StrBucket = ""
Exit Function
End If
StrCutPrefix = Mid(StrGroupID, 5)
StrTemp = Left(StrCutPrefix, 3)
If StrTemp = "NAS" Then
StrBucket = Mid(StrCutPrefix, 4)
Else
StrBucket = StrCutPrefix
End If
newBucket = StrBucket
End Function
Any help will be greatly appreciated. Thank You.