Multiple choice technology

A database field requires the hour that an order is shipped. The date is stored in a 24-hour clock format. Which of the following example will return the value 22 for an order shipped on June 4, 2007 at 10:14PM

  1. GET_DATE_PART( DATE_SHIPPED, 'HH' )

  2. GET_DATE_PART( DATE_SHIPPED, 'HH12' )

  3. GET_DATE_PART( DATE_SHIPPED, 'HH24' )

  4. Any of these would produce the desired output

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

For a 24-hour clock format, HH returns hours in 12-hour format (1-12), HH12 returns 12-hour format with AM/PM indicator, and HH24 returns 24-hour format (0-23). For 10:14 PM stored in 24-hour format (22:14), any of these would return 22 when the hour is 10 PM, because the stored value is already 22.