Querying Records

G

Guest

I am fairly new to access. I have put to together a small horse race
database. I am able to display all horses that say win. What i want to do, is
show, everytime a horse wins, I want to compare to its immediate previous run
eg The immediate previous record, thus enabling me to see if the horse went
up or down in distance.(I have this info in database)
So as well as seeing previous record , is it possible to write formula in
Criteria section of design view that allows me to do this eg an arithmetic
calculation.I have spent countless hours looking in the Help section of
Access, but i cannot find the answer.Any help would be greatly appreciated
Thankyou
 
J

JohnFol

Have a look at DLast.
For example in Nwind, you can list all employees and reference the previous
employees d.o.b. by doing this SQL

SELECT Employees.EmployeeID, Employees.LastName, Employees.HireDate,
DLast("HireDate","[Employees]","EmployeeID <" & [EmployeeID]) AS Expr1
FROM Employees;


Looking at your scenario, if the table HorseRaceResults has a PK, say RaceID
you could probably do something like
DLast("WinningTime", "HorseRaceResults", "HorseID = " & HorseIDFromQuery & "
AND RaceID <= " & RaceIDFromQuery )

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top