About 1,980,000 results
Open links in new tab
  1. How to return only the Date from a SQL Server DateTime datatype

    Sep 22, 2008 · SELECT CONVERT(DATETIME, CONVERT(VARCHAR(10), GETDATE(), 101)) Edit: The first two methods are essentially the same, and out perform the convert to varchar method.

  2. database - how to get current datetime in SQL? - Stack Overflow

    Aug 5, 2009 · 2 For SQL Server use GetDate () or current_timestamp. You can format the result with the Convert (dataType,value,format). Tag your question with the correct Database Server.

  3. Best approach to remove time part of datetime in SQL Server

    Jul 24, 2009 · Which method provides the best performance when removing the time portion from a datetime field in SQL Server? a) select DATEADD (dd, DATEDIFF (dd, 0, getdate ()), 0) or b) select …

  4. sql - How do I get just the date when using MSSQL GetDate ()? - Stack ...

    DELETE from Table WHERE Date > CAST(GETDATE() as DATE); For prior SQL Server versions, date maths will work faster than a convert to varchar. Even converting to varchar can give you the wrong …

  5. sql server - Getdate () function to get date for my timezone - Stack ...

    Nov 20, 2013 · I would love to insert a default value into a column with data type datetime2(7). However, because my website is hosted on a server in a different timezone, the getdate function doesn't work …

  6. sql - Getdate (), -1 day - Stack Overflow

    Jan 12, 2016 · I do not understand why, but somehow this query doesn't work. I want to take system date -1 day where the sysdate is smaller by 1 day then current date. WHERE a.SEND_Date >= …

  7. How to pass GETDATE (Only date) as a parameter in sql server?

    Oct 19, 2020 · DECLARE @DATE DATE = GETDATE(); EXEC ST_PRO_GETUSER @DATE; But part of your question seems to actually be asking how to specify a default parameter value. You can't use …

  8. sql server - SQL, GETDATE in where clause - Stack Overflow

    Jul 11, 2019 · I am trying to use my query as the current day for my SQL query. What I am trying below returns 0 records: select * from [TEST].[dbo].LIMIT where endOfDay = GETDATE() select * from …

  9. sql - Get Hours and Minutes (HH:MM) from date - Stack Overflow

    Jan 17, 2013 · I want to get only hh:mm from date. How I can get this? I have tried this : CONVERT(VARCHAR(8), getdate(), 108)

  10. Getting only Month and Year from SQL DATE - Stack Overflow

    Nov 23, 2009 · I need to access only Month.Year from Date field in SQL Server.