The
DATE_TRUNC() function lets you trim temporal values down to the time unit you need — year, month, day, hour, etc. It's an essential tool for analyzing and grouping temporal data in SQL. On this page, you'll learn how to use
DATE_TRUNC() in practice, see some examples, and break down common mistakes.