Previous Topic Next topic Print topic


DAY

ANSI DB2 SQL/DS XDB
  X   X

The DAY function (also XDAY) extracts the day of the month from a date or timestamp. The format appears below:

DAY(date-expr)

The following query finds the quantity of parts ordered on the first day of the month:

SELECT p_no, SUM(quantity)
  FROM orders, items
  WHERE DAY(o_date) = 1
  GROUP BY p_no
Previous Topic Next topic Print topic