dateBucket method

MssqlExpression dateBucket({
  1. required MssqlDateBucketUnit unit,
  2. required int width,
  3. DateTime? origin,
  4. Duration? zoneOffset,
})

This value snapped back to a fixed-width bucket: DATE_BUCKET.

For the widths a calendar boundary cannot express — ten minutes, fortnights, a week that starts on the day the business says it does. Needs SQL Server 2022; the refusal names the function and the version.

Implementation

MssqlExpression dateBucket({
  required MssqlDateBucketUnit unit,
  required int width,
  DateTime? origin,
  Duration? zoneOffset,
}) => MssqlDateBucket(
  this,
  unit: unit,
  width: width,
  origin: origin,
  zoneOffset: zoneOffset,
);