Converting second timestamp data records into minute records
Posted on 2011-10-17
I have a table that has trading transactions and contains a timestamp field and a ASK price each time the price changes (tick data).
The timestamp has the format:1/1/2009 10:42:00.000000 PM
The records are sequential but do not have a consistent gap. some are the same time, some are 2 seconds apart, some 10 seconds apart.
I wish to load the beginning ask price and the ending ask price for each minute into another table (MIN_Table)
Then I will want to load the beginning and ending ask price for each hour into a third table (Hour_table)
How do I do this in SQL?
I know how to do an Append from one table to another, but How do I have it go through all the records and take the beginning and ending prices for the specific Timestamp time frame?
This is really twisting my head.