sexta-feira, 9 de abril de 2010

SELECT - SEMANA DO MÊS

Pessoal seque select que retorna em que semana no mês está determinada data.

select (extract(day from cast(:dia as date)) +
(extract(weekday from cast(extract(month from cast(:dia as date)) ||'/01/'|| extract(year from cast(:dia as date)) as date)) - 1)) / 7 + 1 as semana
from rdb$database

  © Blogger template 'Perfection' by Ourblogtemplates.com 2008

Back to TOP