try
select 1+(c1-mdy(1,1,year(c1))-weekday(mdy(1,1,year(c1))/7
from t1
HTH,
Marco
____________________________________________________________________________
Marco Greco <marcog@ctonline.it> rem radioterapia 39 95 447828 fax 446558
Informix-FAQ http://www.iiug.org 4glWorks http://www.ctonline.it/~marcog
--- On 22 May 1997 15:30:30 -0700 Sunil Murthy <murthy@aimnet.com> wrote:
I'm looking for either a convenient function or query
to retrieve the week number (1-52) in a year for a given
date. Unlike Sybase or Oracle, I couldnt find an easy way
to do this and its not in the FAQ.
The foll. query will not work since I wouldnt know what the
current year is.
select (EXTEND(c1, MONTH TO DAY) - EXTEND(DATE('01/01/1997'), MONTH TO
DAY))/7
from t1
Also, it doesnt account for the fact that usually the first week of the year
has less than 7 days.
I'm running 7.20 Informix on-line server.
Thanks in advance.
Sunil
-----------------End of Original Message-----------------