Q:

DB2 Between Statement for Last Sunday to This Coming Saturday

I am curious why this does not work:
SELECT *
FROM TABLE
WHERE DATE_TIME_COLUMN BETWEEN
    current date - int((dayofweek(current date))-1)
    AND
    current date + int(7-(dayofweek(current date)))

When this gives me exactly what I want:
select current date - int((dayofweek(current date))-1) days from sysibm.sysdummy1)
select current date + int(7-(dayofweek(current date))) days from sysibm.sysdummy1)

The above two will yield the correct dates that I want my specific date time column to be in between. What am I missing here?

A:

SELECT *
FROM TABLE
WHERE DATE_TIME_COLUMN BETWEEN
current date - ((dayofweek(current date))-1) DAYS
AND
current date + (7-(dayofweek(current date))) DAYS

You have to signify that you are reducing DAYS from current date as shown above.

