In this tutorial we will discuss how to get Current Date in T-SQL which is often required when you create queries which shows current period and need today's date to filter the data.
Version: In this example we used SQL Server 2008 R2 but it should work perfectly in 2008 and 2005
The easiest way to return the current date and time using T-SQL is to use Date and Time Function called
GetDate(), which returns sql server current date and time.
SELECT GETDATE() as CurrentDate
Remember the function returns current date AND time of the server your are connected to. So if you are using remote server which is ten hours ahead and it is 4pm local time then bear in mind that you will get tomorrow's date (2 am)
Hope that helps!