Back to list SQL Server How to Get the Current Date (Without Time) in T-SQL Database: SQL Server Operators:GETDATE(), CAST() Problem: You’d like to get the current date in T-SQL, but you don’t need the time. 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: 5 SQL Functions for Manipulating Strings 18 Useful Important SQL Functions to Learn ASAP Performing Calculations on Date- and Time-Related Values How Often Employees Are Running Late for Work: SQL Datetime and Interval SQL Arithmetic 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 Tags: SQL Server Subscribe to our newsletter Join our weekly newsletter to be notified about the latest posts.