Re: Sql retornar meses



Talvez estes artigos ajudarão.

Pivot Tables - How to rotate a table in SQL Server
http://support.microsoft.com/default.aspx?scid=kb;en-us;175574

Pivot Tables -Dynamic Cross-Tabs
http://www.sqlteam.com/item.asp?ItemID=2955



--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf


"Marco A." <marcobolacha@xxxxxxxxx> wrote in message
news:OK734dWDHHA.2328@xxxxxxxxxxxxxxxxxxxxxxx
preciso fazer uma consulta que me retorne a soma de valores dos meses e
anos
como segue abaixo independente de ter valores ou nao
campos q tenho. datadevencimento, valorpago.
ex. se nao tive nada em janeiro de 2000, deve aparecer 0,00.
obs. nao sei o ano inicial vou pegar a min(datadevencimento) dai vou tirar
o
ano e o mes inicial. e o max(datadevencimento) para o final
se alguem puder me ajudar
obrigado.

2000 2001 2002 ... 200n
jan
fev
mar
.
.
.
Dez




.


Loading