# Database Discussions > Microsoft SQL Server 2005 >  Repeating Records

## Mr B

Hi,

Not sure how to go about this. But say you have a table

Table: Lifecycles

Year   | RepeatTime | Cost
=====================
2005   |  2              | 10
2007   |  3              | 20

The idea being that there is a cost of 10 that occurs in 2005 and repeats every 2 years. Any ideas on how to get a results table that would look like:

Year | Total Cost
=============
2005 | 10
2006 | 0 
2007 | 30       
2008 | 0
2009 | 10
2010 | 20

(obviously a limit on the maximum year would need to be set or the query would never finish)

Cheers

----------


## Mr B

Hi

I have solved this now, so do not worry about answering

Thanks

----------

