Questions tagged [dateadd]

dateadd is a T-SQL function that returns a datetime with the specified number interval added to a specified datepart of that datetime.

dateadd(datepart,number_of_units,date_time_value) is a T-SQL function available in MS SQL Server and the SAP/Sybase family of database products that can add and subtract from datetime values. Subtraction is accomplished by using a negative number_of_units value.

datepart is usually a two letter code which specifies which date or time segment is being added number of units is a signed int value that specifies how much to add to the datepart date_time_value is the datetime that is being manipulated.

SQL Server Syntax

SAP/Sybase Syntax

498 questions
-3
votes
1 answer

SQL dates returns 12/20/18 when it should be 12/20/17

Any help would be appreciated. it works for 2/10/18, 3/10/18 but not 4/10/18 This is to get a date range for a report that runs every month on the 10th for all accounts that are 75 day past due and not reported on last month report DECLARE…
-3
votes
3 answers

How to add and substract 15 minutes from date sql

I have a query to search records depending on latitude longitude and the date. The query works fine for the same date, but I want to get records which are 15 minutes before the date and 15 minutes after the date. Working query is this: SELECT *…
Sid
  • 2,792
  • 9
  • 55
  • 111
-3
votes
1 answer

Crystal Reports formula for number of workdays between first day of current quarter and currentdate

I'm having trouble with this. If I find an answer I'll include it in my post. SQL to calculate number of days in current quarter, for instance. I can't figure it with Crystal Syntax which is where I fall short. for starters, SQL to get 1st day of…
jawz101
  • 89
  • 1
  • 11
1 2 3
33
34