I have an object called AdmissionEncounter which has StartTime and EndTime fields. (both are DateTime)
I have another object called PhysicalExam which has an ExamDate (DateTime)
There can be many PhysicalExams that occur between the StartTime and EndTime of the AdmissionEncounter.
I need to create a predicate to find the PhysicalExam with the ExamDate that is closest to the StartTime of the AdmissionEncounter.
i.e Min(PhysicalExam.ExamDate) where PhysicalExam.ExamDate between AdmissionEncounter.StartTime And AdmissionEncounter.EndTime.
Thanks
Billy Jacobs