HI,
I need read data from a table, my code :
strSQL = "SELECT time,Amount," _
& " Where sampleDateTime = " & "#" & lastDayOfPreviousMonth & "# ;"
Set rs = CurrentDb().OpenRecordset(strSQL)
If rs.EOF Then
'MsgBox .Show(no data)
Else
mTime = rs.Fields("time")
mAmount = rs.Fields("Amount")
End If
rs.Close
Set rs = Nothing
The strSQL in immediate window:
SELECT time,Amount from tblTest Where sampleDateTime = #2/28/2010# ;
And all rs field get null value, but I do have value in the database, what is wrong?
Thanks.
I need read data from a table, my code :
strSQL = "SELECT time,Amount," _
& " Where sampleDateTime = " & "#" & lastDayOfPreviousMonth & "# ;"
Set rs = CurrentDb().OpenRecordset(strSQL)
If rs.EOF Then
'MsgBox .Show(no data)
Else
mTime = rs.Fields("time")
mAmount = rs.Fields("Amount")
End If
rs.Close
Set rs = Nothing
The strSQL in immediate window:
SELECT time,Amount from tblTest Where sampleDateTime = #2/28/2010# ;
And all rs field get null value, but I do have value in the database, what is wrong?
Thanks.