Hi all. I have a db with two tables:
TbTest which has [TestNumber], [TestDate], [TestMethod] and PK-a concatenated filed of [TestNumber] and [Test Method] with serves as the PK.
TbDateRange which gives the [TestMethod], the date range of the parts used-[DateStart] and [DateEnd], and the relevant serial number of the test equipment [BatchNo].
I am trying to write a query that will give me the batch number of the part used for each test in TbTest, e.g, [TestNumber],[BatchNo], based upon the [TestDate] and [DateEnd].
Code:
SELECT TbTest.TestNumber, TbTest.TestMethod, TbTest.TestDate, TbDateRange.DateEnd, DateDiff("d",[DateEnd],[TestDate]) AS Expr1FROM TbDateRange, TbTest
WHERE (((TbTest.TestMethod)="ELECTRODE") AND ((DateDiff("d",[DateEnd],[TestDate]))>0))
ORDER BY DateDiff("d",[DateEnd],[TestDate]);
Im failing miserably. If anyone has any advice, it would be appreciated.
Many thanks,
Mattbro451