angie_angie
asked on
How to use Mid function in SQL statement, anyone can help?
I have the following codes in VBA. Can anyone tell me where goes wrong? I guess it's probably in the Mid function in the SQL statement.
With CurrentDb.OpenRecordset("S ELECT tbl_A.* FROM tbl_A INNER JOIN tbl_B ON " _
& " ( Mid(tlb_A.aFieldThatContai nsCaseID, 58, 5) = str(tbl_B.caseID) ) WHERE tbl_A.fld_1 IS NOT NULL")
While Not .EOF
existVal = Mid(.Fields("aFieldThatCon tainsCaseI D"), 58, 5) & " " & existVal
.MoveNext
Wend
.Close
End With
Open in New Window
With CurrentDb.OpenRecordset("S
& " ( Mid(tlb_A.aFieldThatContai
While Not .EOF
existVal = Mid(.Fields("aFieldThatCon
.MoveNext
Wend
.Close
End With
Open in New Window
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.