In most databases, DATEDIFF provides the whole number of intervals between the start and end dates. ClickHouse rounds those values. For example a 4 day interval registers as a week. SELECT ...