DATETIME2= LIBNAME Statement Option

Specifies the scale for the timestamp literal for Microsoft SQL Server 2008 and the native Microsoft driver.

Valid in: SAS/ACCESS LIBNAME statement
Category: Data Set Control
Default: NO
Data source: Microsoft SQL Server, ODBC
See: DATETIME2= data set option

Table of Contents

Syntax

DATETIME2=YES | NO

Syntax Description

YES

specifies a DATETIME precision and scale when creating the timestamp for the WHERE clause.

NO

uses the first occurring DATETIME precision and scale when creating the timestamp for the WHERE.

Details

When this value is not specified, SAS/ACCESS generates timestamp values in WHERE clauses in a format that matches the format of the column that is being used to subset data.

Last updated: February 3, 2026