What happens if you choose the 4/1 baseline, do you want to see that 4/1 is a baseline by itself or do you want to see the 1/1 baseline measurement?
I'd handle this like this:
First, create a query that correctly pulls the record you're interested in (assuming you have one record per date as your data indicates)
Code:
SELECT tblTest.Equipment_ID, tblTest.WorkDate, tblTest.Baseline, tblTest.Measurement
FROM tblTest
WHERE (((tblTest.Equipment_ID)="A") AND ((tblTest.WorkDate)=[Enter the Date]));
This selects the Equipment item A with a specific work date (NOTE: I changed 'date' to 'workdate' to avoid the use of reserved words and I also changed EQUIPMENT ID to Equipment_ID to avoid having spaces in field names)
Name this query 'qryDataPiece'
Second, create this query:
Code:
SELECT tblTest.Equipment_ID, Max(tblTest.WorkDate) AS MRBaselineDate
FROM tblTest
GROUP BY tblTest.Equipment_ID, tblTest.Baseline
HAVING (((Max(tblTest.WorkDate))<=[Enter the Date]) AND ((tblTest.Baseline)=Yes));
Name this query qryMRBaseline, it will list the most recent baseline measurement based on the date entered by the user
Third create this query:
Code:
SELECT qryDataPiece.Equipment_ID, qryDataPiece.WorkDate, qryDataPiece.Baseline, qryDataPiece.Measurement, qryMRBaseline.MRBaselineDate, tblTest.Measurement AS BaselineMeasure
FROM (qryDataPiece LEFT JOIN qryMRBaseline ON qryDataPiece.Equipment_ID = qryMRBaseline.Equipment_ID) LEFT JOIN tblTest ON (qryMRBaseline.MRBaselineDate = tblTest.WorkDate) AND (qryMRBaseline.Equipment_ID = tblTest.Equipment_ID);
This final query will show you the data related to a specific record (again assuming records are individual by date) and it's related most recent baseline information.