Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
select * from table1 where [part number] <> mid([Orig Information],7,instr(7,[Orig Information],",")-7)
select * from table1 where [Orig Information] LIKE "*"+[Part Number]+"*"
but if let's say every part number into the Orig Information is in format [space]Part No.[comma] (that is " 04567,") then you could use a query like
select * from table1 where [Orig Information] not LIKE "* "+[Part Number]+",*"
Function GetDigits(psStringWithNumbers As String) As String
'8-6-08 s4p
Dim sNumber As String _
, i As Integer _
, sChar As String * 1
sNumber = ""
'loop through and only keep numeric characters
For i = 1 To Len(psStringWithNumbers)
sChar = Mid(psStringWithNumbers, i, 1)
If IsNumeric(sChar) Then
sNumber = sNumber & sChar
Else
'comment if you don't want to stop looking
If Len(sNumber) > 0 Then
GetDigits = sNumber
Exit Function
End If
End If
Next i
GetDigits = sNumber
End Function
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Join the community of 500,000 technology professionals and ask your questions.