V
Vic
Having a rough time using "Like" in an expression. Compare the following two statements
1) strSQL = "Select * from tblLot Where LotNumber = '20040302002' Order By LotNumber
2) strSQL = "Select * From tblLot Where LotNumber Like '20040302*' Order By LotNumber
When I use the first statement with my data, I get a recordcount of 1 (expected
When I use the second, I get a recordcount of 0 (NOT expected
Here's the rest of the code
Dim rst As ADODB.Recordse
Set rst = New ADODB.Recordse
With rs
.ActiveConnection = CurrentProject.Connectio
.CursorType = adOpenKeyse
.CursorLocation = adUseClien
.LockType = adLockOptimisti
.Open strSQL, Options:=adCmdTex
MsgBox "Number of records: " & .RecordCoun
End Wit
Anone have a clue what I'm doing wrong? Much obliged ..
1) strSQL = "Select * from tblLot Where LotNumber = '20040302002' Order By LotNumber
2) strSQL = "Select * From tblLot Where LotNumber Like '20040302*' Order By LotNumber
When I use the first statement with my data, I get a recordcount of 1 (expected
When I use the second, I get a recordcount of 0 (NOT expected
Here's the rest of the code
Dim rst As ADODB.Recordse
Set rst = New ADODB.Recordse
With rs
.ActiveConnection = CurrentProject.Connectio
.CursorType = adOpenKeyse
.CursorLocation = adUseClien
.LockType = adLockOptimisti
.Open strSQL, Options:=adCmdTex
MsgBox "Number of records: " & .RecordCoun
End Wit
Anone have a clue what I'm doing wrong? Much obliged ..