I am looking for basic direction on Cursor use in MSSS.
Say there is a table, TABLE1
, with 2 fields (ID
, Date
). The ID
is not a unique key. The table records events by id, and some ids occur frequently, some infrequently.
For example:
ID | Date
1 | 2010-01-01
2 | 2010-02-01
3 | 2010-02-15
2 | 2010-02-15
4 | 2010-03-01
I would like to create a new table with the following fields: ID, Date, Number of times ID appears in 6 months previous to Date, Number of times ID appears in 6 months after Date.
Is there a best way to go about accomplishing this? Thanks kindly.