About 6,510,000 results
Open links in new tab
  1. Equivalent function for DATEADD () in Oracle - Stack Overflow

    Jun 25, 2014 · I have to get a date that is 6 months from the system date in Oracle. And I have to get it by running an open-query from SQL. DATEADD(MONTH,-6, GETDATE()) function …

  2. sql - Is there a way to use the dateadd() in the where clause in a ...

    Nov 6, 2015 · Here's my problem. In my where clause I am trying to use the between clause with dates. In the second date I add, I need it to return the day after the date that is being input.

  3. sql - Using DATEADD with bigints - Stack Overflow

    Just do the problematic DATEADD in two steps, starting with a coarser time unit (seconds, minutes, hours etc.), then dropping back to the fine grained one for the remainder. Avoid going …

  4. How to get only date part while using dateadd() and getdate()

    Feb 25, 2014 · I want to display records of last 4 months from current date. I don't want to consider time How can I get just date part from the below query? where OrderDate >= …

  5. Dateadd and datediff get last day in month - Stack Overflow

    Jul 3, 2017 · SELECT dateadd( mm, -240 + 22, DATEADD(mm, 1 + DATEDIFF(mm, 0, GETDATE()), -1)) AS n I use the code above cause I need to put in a number in the place for …

  6. sql - How can I use a column's values for DATEADD()'s datepart ...

    Nov 9, 2023 · T-SQL's DATEADD is not a "real" function, it's actually a language-feature (like a statement or control-structure) and the first parameter (datepart) accepts keyword arguments, …

  7. sql server 2008 - DATEADD (MONTH, DATEDIFF (MONTH, 0, …

    select Dateadd(MONTH, 1381, 0) result: 2015-02-01 00:00:00.000 Basically, it gets the first day of the whatever month is specified in the date of the innermost formula. The code i was having to …

  8. How do I convert a value after using DATEADD with it

    Apr 6, 2018 · SELECT (DATEADD(hour,-5,arrival)) FROM( SELECT CONVERT(VARCHAR(8), arrival)) FROM locations )a 4-6-2018 12:35:43. This query will give readd the date. How can I …

  9. Using Parameters in DATEADD function of a Query

    The following code works perfectly fine here (SQL Server 2005, executed in Management Studio): DECLARE @days decimal SET @days = -10 SELECT DATEADD(day, @days, GETDATE())

  10. sql - Get start and end of previous month - Stack Overflow

    Sep 19, 2024 · The old DateAdd/DateDiff from the beginning of time trick for the month interval. DATEADD(month, DATEDIFF ...