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

    Sep 22, 2008 · How to return only the Date from a SQL Server DateTime datatype Asked 17 years, 3 months ago Modified 1 year ago Viewed 3.9m times

  2. DateTime2 vs DateTime in SQL Server - Stack Overflow

    Aug 26, 2009 · Which one: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? I'm aware of differences in precision (and storage space probably), but …

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

    Jul 24, 2009 · Edit, Jan 2012 A worked example of how flexible this is: Need to calculate by rounded time or date figure in sql server Edit, May 2012 Do not use this in WHERE clauses …

  4. How do I query for all dates greater than a certain date in SQL …

    where A.Date >= '2010-04-01' it will do the conversion for you, but in my opinion it is less readable than explicitly converting to a DateTime for the maintenance programmer that will come after you.

  5. sql server - How can I select the first day of a month in SQL?

    I used GETDATE () as a date to work with, you can replace it with the date which you need. Here's how this works: First we format the date in YYYYMMDD... format truncating to keep …

  6. t sql - How to format datetime in SQL SERVER - Stack Overflow

    See the Date and Time Styles section of CAST and CONVERT (Transact-SQL) for all of the built-in formatting styles. I would keep in mind that unless you have a good reason for it, I mean a …

  7. How to convert a datetime to string in T-SQL - Stack Overflow

    Feb 22, 2013 · 19 In addition to the CAST and CONVERT functions in the previous answers, if you are using SQL Server 2012 and above you use the FORMAT function to convert a …

  8. sql - Check if value is date and convert it - Stack Overflow

    May 8, 2013 · 15 I receive data in a certain format. Dates are numeric (8,0). For example 20120101 = YYYYMMDD There exists rows with values like (0,1,2,3,6) in that date field, thus …

  9. How to query DATETIME field using only date in Microsoft SQL …

    Mar 19, 2014 · I have a table TEST with a DATETIME field, like this: ID NAME DATE 1 TESTING 2014-03-19 20:05:20.000 What I need a query returning this row and every row with date …

  10. sql - How to get calendar Quarter from a date in TSQL - Stack …

    Oct 12, 2016 · I have different dates in a column. For example: 20080102 20070821 I want to convert these dates in Year and calendar quarter. E.g., Year Quarter 2008 2008-Q1 2007 …