Iıve got large data set. Each day I load in 8000 stocks, info about how they did that day. So the primary key, an auto incrementing value, numbers them in order.
But Iıd like to sort by Stock ticker, then pull the value from the next dayıs price to stick at the end of a row for the current dayıs information. I got some help the other day on how to lag across records using the primary key and a self join, but after a sort the primary keys are not really what Iım after.... I want tomorrowıs price for the same stock (next record in a sorted dataset) not the next value of the primary key (which is for a different stock). Iım stumped. I thought if I made an index on ³ticker² and ³date² combined, that I could use that index for the lag and Iıd be pretty close. But a) I might be very wrong about that, and b) canıt find any documentation on how to call up that indexıs value as part of a SELECTıs record set. Any ideas? Am I close? -- David L. Van Brunt, Ph.D. Outlier Consulting & Development mailto: <[EMAIL PROTECTED]>