Split function in Access Query

R

ryansarmy

Hello, I have a query that attempts to find differences in a comma
seperated string. The string looks something like
32473,30,30,C,C,80,0,RDS,4/26/2006 1:53:07 PM
in my query I use OldQuantity: Splitem([Itemsforsalekey],",",2)<
and NewQuantity: Splitem([Itemsforsalekey],",",3)
to call my function

Public Function Splitem(TheString As String, _
Delim As String, _
ReturnIndex As Integer) As String
Dim s() As String
s = Split(TheString,Delim)
If ReturnIndex < 1 or ReturnIndex > UBound(s)+1 Then
Splitem = ""
Else
Splitem = s(ReturnIndex-1)
End If
End Function</i>

The problem is when I try to compare the two, I get a data type
mismatch error

In the criteria for OldQuantity I put in Where <>
Splitem([Itemsforsalekey],",",3)

Please help,

Ryan Sarmast
 

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