The following query uses the MONTH function
to extract and show what month the customer call was received and
resolved, and it uses display labels for the resulting columns. However,
it does not make a distinction between years.Figure 1: Query
SELECT customer_num,
MONTH (call_dtime) call_month,
MONTH (res_dtime) res_month
FROM cust_calls;
The following query uses the MONTH function
plus DAY and CURRENT to show
what month the customer call was received and resolved if DAY is
earlier than the current day.Figure 3: Query
SELECT customer_num,
MONTH (call_dtime) called,
MONTH (res_dtime) resolved
FROM cust_calls
WHERE DAY (res_dtime) < DAY (CURRENT);