D
David
QCDate Field1 Field2 Field3 Field 4 MinDate
1/21/04 2/12/04 3/10/04
Objective: Look at each field and compare to determine
which is minimum and put it in the MinDate field. Here is
how I am going about it but doesn't seem to work.
Dim db as dao.database
Dim rst as dao.recordset
Dim tempDate as Date
set db = currentdb
set rst = db.openrecordset("mytable", dbopendynaset)
Do Until rst.eof
If Not isnull(rst!QCDate) then
tempDate = rst!QCDate
If Not IsNull(rst!field1) and rst!field1<=tempDate then
tempDate = rst!field1
If Not IsNull(rst!field2) and rst!field2<=tempDate
then
tempDate = rst!field2
...
...
rst.Edit
rst!MinDate = tempDate
rst.Update
rst.MoveNext
Loop
rst.close
set rst = nothing
This does not seem to be giving me the accurate results.
Has anyone ever incurred this scenario, and if so, how
did
you resolve it.
Thanks
DJ
1/21/04 2/12/04 3/10/04
Objective: Look at each field and compare to determine
which is minimum and put it in the MinDate field. Here is
how I am going about it but doesn't seem to work.
Dim db as dao.database
Dim rst as dao.recordset
Dim tempDate as Date
set db = currentdb
set rst = db.openrecordset("mytable", dbopendynaset)
Do Until rst.eof
If Not isnull(rst!QCDate) then
tempDate = rst!QCDate
If Not IsNull(rst!field1) and rst!field1<=tempDate then
tempDate = rst!field1
If Not IsNull(rst!field2) and rst!field2<=tempDate
then
tempDate = rst!field2
...
...
rst.Edit
rst!MinDate = tempDate
rst.Update
rst.MoveNext
Loop
rst.close
set rst = nothing
This does not seem to be giving me the accurate results.
Has anyone ever incurred this scenario, and if so, how
did
you resolve it.
Thanks
DJ