WEEKSBTWN

ANSI DB2 SQL/DS XDB
      X

This function is used to obtain the difference between dates in weeks. The format appears below:

WEEKSBTWN(date1, date2)

The difference in weeks is determined by the number of Sundays between the two dates, including the first date but not the second. For example, if January sixth is a Sunday, and January thirteenth is a Sunday:

WEEKSBTWN(01/06/1991, 01/13/1991) = 1