Do please check a wonderful article on auxiliary calendar table at
http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-...auxilia I
guess you will get an idea how to solve your problem.
--
Dejan Sarka
http://blogs.solidq.com/EN/dsarka/default.aspx
"Ana" <ananospam DeleteThis @yahoo.es> wrote in message
news:elGCx8ZXIHA.2268@TK2MSFTNGP02.phx.gbl...
> Hello all,
>
> I'm stumble on a project so I would appreciate someone's help.
>
> I've a company which sells several service contracts everyday with
> duration from one to 36 months. The tbl parameters are as follows:
>
> ID, cost, activation_date, start_date, end_date .. among many other
> fields.
>
> The idea is to create a query/report outputting daily and monthly cost
> information considering the leap year.
>
> Example, today's daily report if starting today: sum(cost) / contract
> period in days where start_date = getdate()
>
> Example, tomorrows' daily report if starting today: (today's results -1)
> + (sum(cost) / contract period in days where start_date = getdate())
>
> Hope I've being clear. TIA
>
> Ana
>