Hello Experts,
I am using the below code to find the top value ( minimum value ) of a recordset but sometimes this is
not showing the correct value when I open the table I was able to identify this code is not reflecting the correct ascending order for dates in this field.
I browsed through our forum and found some suggestions to use Cdate but even after using cdate I am not getting the right order. Can you guide me in getting the correct order.
I am using the below code to find the top value ( minimum value ) of a recordset but sometimes this is
not showing the correct value when I open the table I was able to identify this code is not reflecting the correct ascending order for dates in this field.
I browsed through our forum and found some suggestions to use Cdate but even after using cdate I am not getting the right order. Can you guide me in getting the correct order.
Code:
Set rsemp = CurrentDb.OpenRecordset("select top 1 Ename, avlto, freeat from ests order by freeat", dbOpenSnapshot)
rsemp.MoveFirst
.Edit
!employee = rsemp!ename
![avlto] = rsemp![avlto]
![freeat] = DateAdd("n", Nz(rsTask![tasktime]) * 60, DMax("[freeat]", "ests", "[Ename]='" & rsemp!ename & "'"))
.Update
Last edited: