About 473,000 results
Open links in new tab
  1. sql server - How to add days to the current date? - Stack Overflow

    Nov 4, 2014 · I am trying to add days to the current date and it's working fine but when I add 360 days to the current date it gives me wrong value. eg: Current Date is 11/04/2014 And I am adding 360 Days …

  2. How to add hours to current date in SQL Server?

    Aug 29, 2013 · I am trying to add hours to current time like -- NOT A VALID STATEMENT -- SELECT GetDate(DATEADD (Day, 5, GETDATE())) How can I get hours ahead time in SQL Server?

  3. How to add minutes to the time part of datetime - Stack Overflow

    sql sql-server datetime time dateadd edited Aug 19, 2023 at 20:13 user9517769 asked Nov 17, 2015 at 15:19

  4. sql - DATEADD to return data in the last 3 months but I want full …

    Aug 8, 2022 · WHERE Created_Date > DATEADD(DAY, -90, GETDATE()) Both ways return the data in the last 3 months starting from current date. But the thing is, since my query wants to get aggregated …

  5. sql - Using DATEADD with bigints - Stack Overflow

    12 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 to the level of …

  6. Adding a month to a date in T SQL - Stack Overflow

    Aug 16, 2021 · How can I add one month to a date that I am checking under the where clause? select * from Reference where reference_dt + 1 month

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

    Sep 15, 2009 · I want to get the records of last month based on my database table [member] field date_created. How can I use SQL to do this? For clarification, last month - 1/8/2009 to 31/8/2009 If …

  8. sql - 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 serves the …

  9. How to add time to DateTime in SQL - Stack Overflow

    Jul 3, 2013 · SELECT DATEADD(hh, 03, DATEADD(mi, 30, DATEADD(ss, 00, DATEDIFF(dd, 0,GETDATE())))) as Customtime Using the above query, I'm able to achieve it. But is there any …

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

    This works by taking the number of months that have passed since the initial date in SQL's date system (1/1/1990), then adding that number of months to the date "-1" (12/31/1899) using the DATEADD …