DATEADD (datepart , number, date )The designers were consistent with putting the 'datepart' as the first parameter, but for DATEADD, why did they made the base date the last parameter? I think it should be consistent with DATEPART and DATEDIFF, so that the second parameter is always a DATETIME.
DATEDIFF ( datepart , startdate , enddate )
DATEPART ( datepart , date )
Friday, July 30, 2010
SQL Date Functions Syntax
One thing that drives me a little crazy with T-SQL is the syntax of the date functions: