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
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