DATEPART
date/time arithmetic, parts, construction or truncation
What changes
- Input
- date/time arguments
- Output or change
- date/time or integer value
- Return type
- int
Syntax at a glance
DATEPART ( datepart , date )
Work example
Read a numeric date part for a label or grouped analysis.
Include year with month or week and prefer a half-open range for indexed date filtering.
Check your work DATEPART results for week-related parts can depend on DATEFIRST and language settings.
Open Microsoft Learn for full syntax, permissions, and details for your version.