<!-- https://learnsql.cpetoday.com/functions/m/duration-hours -->
# Duration.Hours

Language: Power Query M
Category: Duration
Syntax: Duration.Hours(duration as nullable duration) as nullable number
Summary: Returns the hours part of a duration, from 0 to 23, not counting whole days.
Returns: The hours part as a number, or null when the input is null.
Level: Beginner
Related: Duration.Minutes, Duration.TotalHours, Duration.Days, Duration.From, Time.From

## What it does
Duration.Hours returns the hours part of a duration, after whole days are taken out. A duration of two days and five and a half hours has an hours part of 5. Duration.Hours is good for showing "2 days 5 hours" on a report. For the full number of hours, use Duration.TotalHours.
## Syntax and arguments
- duration: a duration value, usually the difference between two datetimes.
## Example
An approval workflow records when each invoice was submitted and when it was approved. The team shows the elapsed time as days and hours for the approval report.

```powerquery
let
    Submitted = #datetime(2026, 10, 27, 9, 0, 0),
    Approved = #datetime(2026, 10, 29, 14, 30, 0),
    Elapsed = Approved - Submitted,
    Days = Duration.Days(Elapsed),
    Hours = Duration.Hours(Elapsed),
    Minutes = Duration.Minutes(Elapsed)
in
    {Days, Hours, Minutes}
```

The elapsed time is 2 days, 5 hours and 30 minutes. The three parts are 2, 5 and 30, which together read as "2 days 5 hours 30 minutes".
## Example: a second, different use
Show the hours component of a time spent figure on a timesheet, where the total is more than a day, to read it as days and hours.
## Things to watch
- The hours part never goes above 23. Use Duration.TotalHours for the full count.
- The days and hours are separate parts. Add them with care, because 2 days and 5 hours is not 5 hours.
- A duration built from a whole number of hours can show zero hours in the component.
- Null in gives null out.
## In business terms
Approval times, close checklist timing and service levels are reported in hours. Splitting the duration into days and hours keeps the report readable, and the total hours figure keeps the service level calculation exact.
