DateTrunc

Truncates (rounds) a datetime to the specified precision

DateTrunc("2022-01-19 20:00:00", DateValueOption.MONTH) → 2022-01-01 00:00:00
DateTrunc("2022-10-28 20:00:00.000", DateValueOption.YEAR) → 2022-01-01 00:00:00.000

Inputs

DateTrunc(dateTime, datePart)

  • dateTime - Date, time, or datetime value

  • datePart - This indicates the units of time that you want to add, ex. DateValueOption.MONTH

Last updated