P
palros77
Guest
Hi,
I have a table which has the date of all premiership football matches played in the 02/03 season called [Matches]. It has two fields, [Date] and [Team], with the primary key defined as a combination of these two fields.
I am trying to create a query that for each match will also give me the date of that teams previous match, and this is what I have so far:
SELECT
Matches.Date,
Matches.Team,
DMax("[Date]","Matches","[Team] = ' " & [Team] & " ' AND [Date] < # " & [Date] & " # ") AS [D-1]
FROM Matches;
When I run this query the expression for [D-1] works fine for most of the records and returns a blank for the first matches as expected. However it returns a blank for quite few other records, and returns the wrong date for some.
Can anybody tell me why this doesn't work, as I am baffled by it!?
Cheers,
Paul.
I have a table which has the date of all premiership football matches played in the 02/03 season called [Matches]. It has two fields, [Date] and [Team], with the primary key defined as a combination of these two fields.
I am trying to create a query that for each match will also give me the date of that teams previous match, and this is what I have so far:
SELECT
Matches.Date,
Matches.Team,
DMax("[Date]","Matches","[Team] = ' " & [Team] & " ' AND [Date] < # " & [Date] & " # ") AS [D-1]
FROM Matches;
When I run this query the expression for [D-1] works fine for most of the records and returns a blank for the first matches as expected. However it returns a blank for quite few other records, and returns the wrong date for some.
Can anybody tell me why this doesn't work, as I am baffled by it!?
Cheers,
Paul.