Scalar. Computes a new timestamp based on the provided timestamp, multiple and date_part arguments, with subordinate parts set to zero. The result is then rounded down to the maximum date_part multiple that is less than or equal to the input timestamp.
DATEFLOOR( date_part, expression [, multiple] )
date_part | Keyword that identifies the granularity desired. The valid keywords are identical to the date parts supported for the existing function, datepart(). |
expression | A date-time expression that contains the value to be evaluated. |
multiple | Contains a multiple of date_parts to be used in the operation, which if supplied must be a non-zero positive integer value. If none is provided or it is NULL, this is assumed to be 1. |
Year yy Quarter qq Month mm Week wk day dd hour hh minute mi second ss millisecond ms
This function zeroes out all datetime values with a granularity finer than that specified by date_part. Date_part is a keyword, and expression is any expression that evaluates or can be implicitly converted to a datetime (or timestamp) datatype. Multiple is an integer that contains the multiples of date_parts to be used in performing the floor operation. For example, to establish a date floor based on 10 minute intervals, use MINUTE or MI for date_part, and 10 as the multiple.
Sybase extension.
DATEFLOOR( MINUTE, "August 13, 2008 10:35.123AM") returns "August 13, 2008 10:35.000AM"