Debug.print r(0).name = pDate.Code:sql = "SELECT *, cdate([LastBatch]) as pDate FROM tblMain Where LastBatch > " & CLng(GetStoredDate) & " And Source = " & Chr$(34) & s & Chr$(34) & " Order by cdate(LastBatch);" Set r = db.OpenRecordset(sql)
Debug.print r(1).Name = id
But the first field in the table is id. Why is pDate before id ?