PrevRecVal in a Table?

BlueCarpet

New member
Local time
Today, 05:21
Joined
Sep 1, 2003
Messages
9
HI, I have been reading the many postings on the PrevRecVal function and it seems to be the one I need to use for some calculcations. However, much of the discussion concerns its use in forms or reports, is it possible to use the function in a table. I have a database of entries of financial trades which are added to daily. Now, before the daily data is appended to the RecordTable, I have a query showing me which particular Names have traded that day. What I need to do is reference the daily list against the existing list to see when the name last traded. More importantly though, I need to retrieve trade details for that previous entry so I can calculate percentage changes in price since the previous trade. Any help appreciated.
 
Thanks for the advice. I am still having trouble isolating only the last Entry of the Field that I want to search for. I am currently rebuilding the database to make sure that there is another ID field to search under (maybe so I can use the DLookup function) but at the moment I am still struggling. Any clues which topics in particular discussed this issue, I must have read through a few dozen today without finding the solution.
 
If you only want the last record in the recordset,you can use Max on your date field
 
Perhaps last was the incorrect expression to use;

Suppose I had a field of data like such.......

1 Aug AD123 Mr Smith 45
1 Aug AD124 Mr Jones 34
1 Aug AD161 Mr Johns 45
3 Aug AD123 Mr Smith 34

How could I set up a query such that I can specify that given today (3 Aug) AD123 has appeared, it goes back to search for the last time that record appeared in the database then either returns the value of 45 or can use the value to give me a percentage change. Bear in mind that there will be tens on thousands of entries for each ID as opposed to the 2 that I have in this example.
 

Users who are viewing this thread

Back
Top Bottom