---
title: "statistics(for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkstatisticscollection/statistics(for:)"
---

# statistics(for:)

Returns the statistics object for the time interval that contains the provided date.

## Declaration

```swift
func statistics(for date: Date) -> HKStatistics?
```

## Parameters

- `date`: The target date.

## Return Value

Return Value A statistics object for the time interval containing the provided date. If there are no samples for the selected time interval, the statistics object has a nil-valued quantity.

## See Also

### Accessing Statistics Collections

- [statistics()](healthkit/hkstatisticscollection/statistics().md)
- [enumerateStatistics(from:to:with:)](healthkit/hkstatisticscollection/enumeratestatistics(from:to:with:).md)
