SQL Flow Field Guide

@@DATEFIRST

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

date/time arithmetic, parts, construction or truncation

What changes

Input
date/time arguments
Output or change
date/time or integer value
Return type
tinyint

Syntax at a glance

@@DATEFIRST

Work example

Inspect the first day of the week configured for the current session.

Set the week convention explicitly when DATEPART or DATENAME drives a report grouping.

Check your work DATEFIRST is session state and can change week-related results.

Open Microsoft Learn for full syntax, permissions, and details for your version.