Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select datepart(dw,getdate()) as dayofweek
select * from Table
where datepart(dw,Table.DateField) = 2
declare @sourcedate varchar(17)
select @sourcedate = '21/01/03 12:03:32'
select convert(datetime,@sourcedate) as sourcedate
declare @sourcedate varchar(17)
select @sourcedate = '21/01/03 12:03:32'
select
substring(@sourcedate,4,3) + left(@sourcedate,3) + substring(@sourcedate,7,11) as sourcedate,
datepart(dw,convert(datetime,substring(@sourcedate,4,3) + left(@sourcedate,3) + substring(@sourcedate,7,11))) as dayofweek
sourcedate dayofweek
----------------- -----------
01/21/03 12:03:32 3
select
substring(PurchaseDate,4,3) + left(PurchaseDate,3) + substring(PurchaseDate,7,11) as PurchaseDate,
datepart(dw,convert(datetime,substring(PurchaseDate,4,3) + left(PurchaseDate,3) + substring(PurchaseDate,7,11))) as dayofweek
from Orders (nolock)