How do I implement First() and Last() aggregates like Access in MS-SQL?
Posted on 2006-05-02
Hi! I need First() and Last() aggregates for MS-SQL that work like the same-named aggregates in Access. My specific use is the I have financial "tick" values (date/time with price) that I want to roll up into a standard Open/High/Low/Close bar. Min() and Max() work great for the Low and High values but I need something to get the first (Open) and last (Close) values as well. I will be grouping the bars on one-minute intervals. Any help in this regard would be greatly appreciated. Thanks....