SELECT the Current Date Without Time in T-SQL Example

Let’s look at an example on how to select the current date without time in T-SQL.

First, we will create a demo database to run the query.

CREATE DATABASE w3wiki;
USE w3wiki;

Query:

SELECT CAST( GETDATE() AS Date )

Get the Current Date Without Time in T-SQL


How To Get the Current Date Without Time in T-SQL?

To get the current date in T-SQL use the GETDATE() function. The result of the function is DateTime data type meaning, it contains both the date and the time, e.g. 2022-07-10 10:32:04.

However, to get the current date without time in T-SQL use the CAST() function. This function takes any expression or any column name as the first argument. Then you use the keyword AS and enter the new data type to return. (The returned value(s) could be column values or the result returned by the expression.)

Similar Reads

Syntax

Syntax to get the current date without time in T-SQL is:...

SELECT the Current Date Without Time in T-SQL Example

Let’s look at an example on how to select the current date without time in T-SQL....

Contact Us