|
Execute the following
Microsoft SQL Server Transact-SQL script in SSMS Query Editor to obtain the date for last Sunday:
use AdventureWorks;
select dateadd(day,1-datepart(dw, getdate()),
getdate()) ;
Datetime conversion links:
http://sqlusa.com/bestpractices/datetimeconversion/
http://sqlusa.com/bestpractices2005/centurydateformat/
http://sqlusa.com/bestpractices2005/sqlserverstringtodate/
|