Table of contents

DATEADD (Azure Stream Analytics)

Mary McCready|Last Updated: 6/1/2018
|
3 Contributors

Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date.

Syntax

DATEADD ( datepart , number, date )  

Arguments

datepart

Is the part of startdate and enddate that specifies the type boundary crossed. The following table lists all valid datepart arguments.

datepartAbbreviations
yearyy, yyyy
quarterqq, q
monthmm, m
dayofyeardy, y
daydd, d
weekwk, ww
weekdaydw, w
hourhh
minutemi, n
secondss, s
millisecondms
microsecondmcs

number

Is an expression that can be resolved to a bigint that is added to a datepart of date. If you specify a value with a decimal fraction, the fraction is truncated and not rounded

date

Is an expression that can be resolved to a datetime. date can be an expression, column expression, or string literal

Return Types

bigint

Examples

SELECT DATEADD(hour,2,EntryTime) AS AdjustedTime
FROM Input TIMESTAMP BY EntryTime  
WHERE Toll > 5  
© 2018 Microsoft