About 175,000 results
Open links in new tab
  1. SQL DATEPART(dw,date) need monday = 1 and sunday = 7

    Jul 22, 2014 · I have a Query where I get the WeekDay of a date but by default: Sunday = 1 Moday = 2 etc. The function is: DATEPART(dw,ads.date) as weekday I need the result so: …

  2. How to return only the Date from a SQL Server DateTime datatype

    Sep 22, 2008 · Except, say, if you want a query that retrieves all records matching a user-supplied date as the date-part of a certain time field. Good luck doing that only in the presentation layer.

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

    Mar 19, 2014 · 28 I am using MySQL 5.6 and there is a DATE function to extract only the date part from date time. So the simple solution to the question is -

  4. sql - When to use DATE_TRUNC () vs. DATE_PART ()? - Stack …

    Feb 8, 2023 · The function date_trunc is conceptually similar to the trunc function for numbers. date_trunc (field, source [, time_zone ]) source is a value expression of type timestamp, …

  5. Get only the Date part of DateTime in mssql - Stack Overflow

    Aug 21, 2015 · Closed 13 years ago. Possible Duplicate: Get just the Date from grouping in select from DateTime column in SQL Server How can I get only the Date part of a DateTime ? I'm …

  6. Extracting hours from a DateTime (SQL Server 2005)

    May 28, 2017 · Or you could save a few lines with a modulus: DATEPART (HOUR, R.date_schedule) % 12 , and simpler case statements to handle the 0s (which should return …

  7. sql - Compare DATETIME and DATE ignoring time portion - Stack …

    Feb 6, 2018 · When SQL Server converts the literal to the filtered column’s type, it assumes midnight when a time part isn’t indicated. If you want such a filter to return all rows from the …

  8. How to get just the date part of getdate()? - Stack Overflow

    Aug 24, 2012 · I have a SQL table that has a CreationDate field. I have getdate() in the computed column specification formula. I would like to know how to get just the date portion, that is, …

  9. Getting only day and month from a date field - Stack Overflow

    Mar 1, 1994 · 10 Convert your dates using the following format, it will only month and the date part. You have to replace getdate () with you date fields.:

  10. How to compare datetime with only date in SQL Server

    Aug 29, 2014 · How to compare datetime with only date in SQL Server Asked 11 years, 2 months ago Modified 6 years, 1 month ago Viewed 429k times