M
MBC
I'm looking for a search pattern to match call numbers in a library
catalog database. I want to find all call numbers that begin with 8 and
end with 3. The call numbers are anywhere from 3-7 digits,with or
without a decimal point in them. The call number field is designated as
text. The dewey number is followed by a cutter which is alphanumeric
ex. 813 MAR GERMAN, 815.2993 LEN FRENCH, 866.13 GRI SPANISH and
unfortunately, some also have volume numbers at the end like v. 3
The function looks like this:
Function SubGroup(Item As String, LOCATION As String, CallNumber As
String, StartofCall As String) As String
Dim this As String
If StartofCall Like "8*[.]*3" Then SubGroup = "AF"
ElseIf StartofCall Like "8*3" Then SubGroup = "AF"
(Then there are other If statements that look for other types of
call numbers--this part works fine. Then I have
ElseIf StartofCall Like "###" Then SubGroup ="ANF" (trying to catch
all the call numbers that don't match any of the above possibilities)
Else SubGroup = "UnBK"
End If
This works pretty well with the call numbers that don't have a decimal
in them but is not working at all for those that do. For instance it's
matching on numbers like 813.54 (the part of the number before the
decimal begins with 8 and ends with 3, but that's not what I want)or
812.45 DEB FRENCH v. 3 and grouping them as AF when they should be ANF.
It seems to be ignoring the part of the dewey that comes after the
decimal. I want it to look at the whole dewey number and ignore all the
alphanumeric stuff that comes after it. I've tried other variations
like "8##[.]*3" and "8??[.]*3", etc.
Can anyone help?
catalog database. I want to find all call numbers that begin with 8 and
end with 3. The call numbers are anywhere from 3-7 digits,with or
without a decimal point in them. The call number field is designated as
text. The dewey number is followed by a cutter which is alphanumeric
ex. 813 MAR GERMAN, 815.2993 LEN FRENCH, 866.13 GRI SPANISH and
unfortunately, some also have volume numbers at the end like v. 3
The function looks like this:
Function SubGroup(Item As String, LOCATION As String, CallNumber As
String, StartofCall As String) As String
Dim this As String
If StartofCall Like "8*[.]*3" Then SubGroup = "AF"
ElseIf StartofCall Like "8*3" Then SubGroup = "AF"
(Then there are other If statements that look for other types of
call numbers--this part works fine. Then I have

ElseIf StartofCall Like "###" Then SubGroup ="ANF" (trying to catch
all the call numbers that don't match any of the above possibilities)
Else SubGroup = "UnBK"
End If
This works pretty well with the call numbers that don't have a decimal
in them but is not working at all for those that do. For instance it's
matching on numbers like 813.54 (the part of the number before the
decimal begins with 8 and ends with 3, but that's not what I want)or
812.45 DEB FRENCH v. 3 and grouping them as AF when they should be ANF.
It seems to be ignoring the part of the dewey that comes after the
decimal. I want it to look at the whole dewey number and ignore all the
alphanumeric stuff that comes after it. I've tried other variations
like "8##[.]*3" and "8??[.]*3", etc.
Can anyone help?