How to Get the Current Date (Without Time) in T-SQL Database: MS SQL Server Operators: GETDATE() CAST() Table of Contents Problem: Solution: Discussion: Problem: When working with SQL Server, you often need to get the current date without the time component. To achieve this in T-SQL, you can use several straightforward methods. Here, we will show you the most efficient and easiest way. Solution: We’ll use the GETDATE() function to get the current date and time. Then we’ll use the CAST() function to convert the returned datetime data type into a date data type. SELECT CAST( GETDATE() AS Date ) ; Here’s the result of the query: 2019-08-17 Discussion: To get the current date and time in SQL Server, use the GETDATE() function. This function returns a datetime data type; in other words, it contains both the date and the time, e.g. 2019-08-20 10:22:34. (Note: This function doesn’t take any arguments, so you don’t have to put anything in the brackets.) However, if you want to get just the current date – not the date and the time – you can 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.) In our example, the function GETDATE() returned the current date and time as 2019-08-17 20:05:34.540. By using CAST() with GETDATE(), the query above returned only the date 2019-08-17. Recommended courses: SQL Basics in SQL Server Common Functions in SQL Server Recommended articles: SQL Server Cheat Sheet Top 29 SQL Server Interview Questions 5 SQL Functions for Manipulating Strings Performing Calculations on Date- and Time-Related Values See also: How to Get the Year from a Date in T-SQL How to Get the Month from a Date in T-SQL How to Get the Day from a Date in T-SQL Subscribe to our newsletter Join our monthly newsletter to be notified about the latest posts. Email address How Do You Write a SELECT Statement in SQL? What Is a Foreign Key in SQL? Enumerate and Explain All the Basic Elements of an SQL Query