About 1,590,000 results
Open links in new tab
  1. sql server - Get the last day of the month in SQL - Stack Overflow

    I need to get the last day of the month given as a date in SQL. If I have the first day of the month, I can do something like this: DATEADD (DAY, DATEADD (MONTH,'2009-05-01',1), -1) But …

  2. sql server - SQL Subtract exactly a year - Stack Overflow

    Aug 4, 2014 · I want the user to input a date, then get the current year. subtract the two and then do the dateadd that everyone was posting. Is this possible and what is the best way to do it?

  3. sql server - sql - beginning of hour, month etc - Stack Overflow

    1 From SQL Server 2022 you can use for both these needs. I need to get the current date with the beginning of this hour. For example: 2009-09-17 17:00:00

  4. sql - GETDATE last month - Stack Overflow

    Jul 12, 2009 · In other words, getting values between 6/1/2009 and 6/30/2009 won't get you what you want as all of 6/30/2009 is excluded. If you use the first day of July (7/1/2009) you are …

  5. sql server - How to find a date in sql of previous 10 year first day

    Jan 1, 2009 · I writing a query where I need to get a data from last 10 year i.e. (01/01/2009) to todays (07/04/2019). But the query I have written is returning the date 07/04/2009.

  6. sql server - How can I use a SQL UPDATE statement to add 1 year …

    Aug 16, 2013 · When I look at your question, it seems you have already answered that in part by saying DATEADD. If people ask questions, they could easily find in books online - this will …

  7. sql server - Using Parameters in DATEADD function of a Query

    I am trying to us the DateAdd function of SQL in my Query. The problem is when I use a parameter to set the second arguement, the number argument I get an error which will say …

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

    Nov 23, 2009 · Some of the databases such as MS ACCESS or RODBC may not support the SQL SERVER functions, but for any database that has the FORMAT function you can simply …

  9. SQL to return list of years since a specific year - Stack Overflow

    Mar 9, 2009 · The requirement is simply to populate a parameter drop-down on a SQL Report to allow selection of any year since 2004.

  10. Get the records of last month in SQL server - Stack Overflow

    Sep 15, 2009 · Using YEAR(), MONTH(), DATEPART() or similar functions on the date being filtered eliminates any possibility that SQL server can optimize the query to use an index on …