Originally Posted by
ssanfu
If you have a field in a table that is named "datetime", you shouldn't. "datetime" is a reserved word in Access and shouldn't be used for object names. Plus it is not very descriptive. Maybe use "dtTrade" or "TradeDateTime".
Since Access doesn't have record numbers, the 21st or the 101st records are arbitrary. There is no assurance that a record will have the same absolute position if the Recordset object is re-created again because the order of individual records within a Recordset object isn't guaranteed unless it's created with an SQL statement by using an ORDER BY clause.
Will there ALWAYS be an 80 record difference between the records used to calc the trend?
101 -> 21
102 -> 22
103 -> 23
You might be able to write an UDF to do the calculation. Without your dB or some test data, I can't give a better suggestion.