DateDiff



Returns the number of intervals between two date/time values (date2 minus date1). See DateAdd for the interval names.

Numeric DateDiff(String date1, String date2, String interval)

round-pushpin Returns 60.
SELECT DateDiff('2024-01-01', '2024-03-01', 'Day') as Days FROM Single

round-pushpin Returns the minutes between now and ten days ago.
SELECT Round(DateDiff(DateTimeUTC(), DateAdd(DateTimeUTC(), 'Day', -10), 'Minute')) as Minutes FROM Single




SQL :: NullWhenNumeric
Returns null when the number equals compareToValue, otherwise returns the number.
SQL :: Pow
Returns x raised to the power of y.
SQL :: Right
Returns the given number of characters from the end of the value.
SQL :: Round
Rounds a number to the given number of decimal places. Midpoint values are rounded to the nearest even number (2.5 rounds to 2).
SQL :: Scalar Functions
Scalar functions are evaluated once per row.
SQL :: Sha1
Returns the SHA-1 hash of the value's UTF-8 bytes as a lower case hex string.
SQL :: Sha256
Returns the SHA-256 hash of the value's UTF-8 bytes as a lower case hex string.
SQL :: Sha512
Returns the SHA-512 hash of the value's UTF-8 bytes as a lower case hex string.
SQL :: ShowScalarFunctions
Lists the built-in scalar functions with their parameters and descriptions.
SQL :: SubString
Returns length characters of the value, starting at the zero-based startIndex.