I wrote some code that creates a table with a date/time field at
15-minute intervals. Here's how I create and populate the table
With tblDataTemp
..Fields.Append .CreateField("CT_ID", dbLong)
..Fields.Append .CreateField(strTmpIDFld, dbLong)
..Fields.Append .CreateField(strTmpDateFld, dbDate)
..Fields.Append .CreateField(strTmpDataFld, dbDouble)
End With
..
..
..
dtAdd = AdjustTime(dtStart)
Do While dtAdd < dtEnd + 1 + 15 / 1440
rstDataTemp.AddNew
rstDataTemp.Fields(strTmpDateFld).Value = dtAdd
rstDataTemp.Update
dtAdd = dtAdd + 15 / 1440
Loop
I then use the FindFirst method to search for a record with a specific
date/time. Here is that line in the code:
rstDataTemp.FindFirst ("[" & strTmpDateFld & "]" & "=#" + strAdjDate +
"#")
The problem is, it only works for times up to 4/18/2005 15:30 (this
happens to be the first 3 records, but I have tried deleting those
first 3 records and then it finds nothing). I have stopped the code,
copied and pasted the value of strAdjDate into a query, and it doesn't
find the record. I have even copied and pasted a value directly from
the table I created into the criteria of the query builder and it
*still* doesn't return the record.
I have some similar code that creates records with date/time (but one
at a time, it reads the dates from another table then writes to this
table), and I use a FindFirst on that and it works fine:
rstData.FindFirst ("[" & strDateFld & "]" & "=#" + theAdjDate + "# AND
[" & strIDFld & "] = " & Trim(Str(numID)))
So I'm thinking it has to do wtih the way I'm creating the table in the
first place?? Anyone have any idea?
Thanks
Rebecca