sql querry problem

N

nokia3650

i have an update querry that should pull number out of a string.the strings
are standardized(same). i thought it would be good to pull out the start
position of the nummber and the end position of the number.

here is the code for start position:

Public Function isPocetakBroja(ByVal IngFactor As String) As Long

Dim pocetakBroja, krajBroja, drugipocetakBroja As Long
'assumes that the FactorSum value is a number, and is a Long Integer.
Select Case Left(IngFactor, 8)
Case Is = "dov. zal"
pocetakBroja = InStr(10, IngFactor, "dana (", vbTextCompare) + 6
drugipocetakBroja = InStr(10, IngFactor, "dana (>", vbTextCompare) + 7
If drugipocetakBroja > pocetakBroja Then
isPocetakBroja = Right(Left(IngFactor, krajBroja), drugipocetakBroja)
Else
isPocetakBroja = Right(Left(IngFactor, krajBroja), pocetakBroja)
End If
Case Is = "dovoljno"
pocetakBroja = InStr(5, IngFactor, "no (", vbTextCompare) + 4
drugipocetakBroja = InStr(5, IngFactor, "no (>", vbTextCompare) + 5
If drugipocetakBroja > pocetakBroja Then
isPocetakBroja = Right(Left(IngFactor, krajBroja), drugipocetakBroja)
Else
isPocetakBroja = Right(Left(IngFactor, krajBroja), pocetakBroja)
'...here is type mismatch
End If
Case Is = "sti¾e da"
isPocetakBroja = 5
Case Else 'use this if you need a default for records outside of all
isPocetakBroja = 999
End Select

End Function

the strings look like:

dovoljno (4 kom), poslije vi¹e ne.
sti¾e za 14 dana
dovoljno (11 kom)
dovoljno (>100 kom)

but i get a erron saying :
run time error 13

type mismatch

in line 20

where is the problem

how to solve it?

thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top