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

    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 to it,...

  2. sql - Is there any difference between these three uses of DATEADD ...

    Jan 17, 2011 · the datepart "weekday" changes (by 1) when the day changes the datepart "day" changes (by 1) when the day changes So you have to argue that the "unit of" dayofyear is equal to …

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

    How to add minutes(INT) to the time part of datetime ? For example : If I have datetime variable like this : @shift_start_time = 2015-11-01 08:00:00.000 @increase = 30 How to get this result...

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

    SELECT FieldOne, DateField FROM Table WHERE (DateField> DATEADD(day, @days, GETDATE())) Where @days = -10 Any ideas into what I am doing wrong? Incidentally I am setting this variable in …

  5. Update a date in SQL using DATEADD - Stack Overflow

    Sep 21, 2020 · I am trying to update several datetime records in a sql table. The values which i'm trying to update are all like this: 2019-01-01 23:59:59.000 and I'm looking to update them adding one …

  6. sql - between getdate () and DATEADD (m, -1, getdate ())) on where ...

    Aug 11, 2015 · WHERE SomeDate BETWEEN DATEADD(m, -1, GETDATE() and GETDATE() The smaller value goes first, which in this case is DATEADD

  7. 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. For example: …

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

    this will give you the first of the month for a given date inner select select DATEDIFF(MONTH, 0, GETDATE()) will give the number of months from 1900-01-01 here it is 1350 this will be add to 1900 …

  9. SQLite equivalent of SQL Server DateAdd function

    Sep 17, 2015 · I need help reproducing the following SQL statement to a statement that SQLite understands. SELECT * FROM SomeTable WHERE [Date] >= DATEADD(day, -14, GETDATE()) …

  10. 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 just the 6 leftmost …