RE: week no. for a date
Posted in 1998
Bernstein, Rick — — source: Informix-list mailing list archive (1991-1998)
The following expression treats Sunday as the beginning of the week. TRUNC((dates+6-MDY(1,1,YEAR(dates))-WEEKDAY(dates))/7,0)+1 You can adjust it accordingly if you want Monday to be the first day of the week. -----Original Message----- From: Girish Kagrana [mailto:girishk@infogain.com] Sent: Tuesday, December 29, 1998 11:37 To: informix-list@iiug.org Cc: IG-Girish Kagrana Subject: week no. for a date How Can I find WEEK NO. for a given date. For eg. Date is in MM/DD/YY format Date WEEK NO. for the YEAR ----- ------------ 01/04/98 - 1 01/05/98 - 2 12/29/98 - 53 TIA Girish