---
title: orderByQuantitySampleStartDate
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkquantityseriessamplequery/orderbyquantitysamplestartdate
---

# orderByQuantitySampleStartDate

A Boolean value that determines whether the query groups the results based on the quantity sample’s start date.

## Declaration

```swift
var orderByQuantitySampleStartDate: Bool { get set }
```

## Discussion

Discussion By default the query returns all the quantities in ascending order based on their start date. If you set this property to true, HealthKit first sorts the matching HKQuantitySample objects by their startDate parameter. Then, for each sample, it returns all the quantity objects in ascending order. If the sample objects overlap, then the quantities may not appear in ascending order when switching from one sample to the next.

## See Also

### Creating a Series Query

- [init(quantityType:predicate:quantityHandler:)](healthkit/hkquantityseriessamplequery/init(quantitytype:predicate:quantityhandler:).md)
- [includeSample](healthkit/hkquantityseriessamplequery/includesample.md)
