Others

Convert SQL Server DateTime to Date in Microsoft Access

Anum MushtaqAnum Mushtaq Oct 20, 2026 871 views

Question details

The user needs to extract only the date portion from a linked SQL Server DateTime field in Microsoft Access and format it as a ten-character date (mm/dd/yyyy).

How to Convert a SQL Server DateTime Value to a Date in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Displaying and filtering only the date portion of a datetime field imported or linked from SQL Server, specifically handling datetime2 fields where standard functions might fail.
Observed behavior
The linked field includes both the date and fractional time components. Using the DateValue function results in a 'Data type mismatch in criteria expression' error, especially when handling SQL Server datetime2 values with Date/Time Extended support enabled.
Before you start

Verify the exact data type of your SQL Server field in the table design. Ensure it is a valid date format (like datetime or datetime2) and not a timestamp/rowversion data type, which is an auto-generated binary number and cannot be converted to a date.

Solution 1Recommended

Use the DateSerial Function to Extract the Date

Use the DateSerial function combined with Year, Month, and Day functions to safely convert datetime2 fields without triggering a data type mismatch error.

While DateValue is commonly used to extract dates, it can fail and return errors when processing datetime2 values in Microsoft Access. DateSerial bypasses this issue by explicitly constructing the date from the extracted year, month, and day integers.

1
Open Query Design

Open your Microsoft Access database, right-click the query containing your linked SQL Server table, and select 'Design View'.

2
Apply DateSerial Expression

In a blank column on the query grid, type the following expression: ConvertedDate: DateSerial(Year([Create_Date]), Month([Create_Date]), Day([Create_Date])).

3
Format the Date

Click on the new ConvertedDate field, open the Property Sheet (press F4), and type 'mm/dd/yyyy' into the Format property field to ensure it displays as a ten-character date.

Use the DateSerial Function to Extract the Date
Handling Null Values: If your field contains null values, wrap the field references in the Nz() function or add an IIf statement to prevent calculation errors on empty rows.
Free Microsoft Office alternative

Looking for a versatile office suite? Try WPS Office

While Microsoft Access is designed for complex relational databases, many everyday data tracking, formatting, and filtering tasks can be effortlessly managed using spreadsheets. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, featuring a powerful spreadsheet tool for managing your data sets effectively.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install and Launch: Follow the on-screen instructions to install the suite, then open WPS Spreadsheet to start managing your data.
  3. 3. Open Your Data Files: Easily open your exported CSV or XLSX database files with full compatibility.
Completely free and lightweight office suiteHigh compatibility with Microsoft Office formats (XLSX, DOCX, PPTX)Familiar user interface for immediate productivityAdvanced data filtering and custom date formatting in WPS SpreadsheetSeamless migration from other Office platforms
microsoft office alternative - wps office

Frequently Asked Questions

Why does the DateValue function return a 'Data type mismatch' error in Microsoft Access?

This error frequently occurs when evaluating a SQL Server datetime2 value in an Access query, especially if Date/Time Extended support is enabled. The DateValue function struggles to parse the extended fractional seconds. Using DateSerial is a more reliable workaround.

Can I convert a SQL Server timestamp field to a date in Access?

No. Despite its name, the SQL Server timestamp data type (also known as rowversion) is a binary number used for versioning rows. It does not contain date or time information and cannot be converted to one.

How can I permanently format a query field as mm/dd/yyyy?

In Query Design view, select the column you wish to format, open the Property Sheet by pressing F4, find the 'Format' row, and manually type 'mm/dd/yyyy'.