I can't seem to find any documentation on the dateadd and/or datediff functions in DB2, so I take it that they don't exist.

I need to calculate the First day of the month and the first day of the week based on a date field. So far, here is what I figured out:

First Day of month of field process_date

process_date-DAY(process_date) DAYS+ 1 DAY

First Day of week of field process_date

process_date-Dayofweek(process_date) days + 1 DAY

Anyone with a better way? Any flaws in the above functions?

dag