Create FUNCTION DayOfWeek
(
@Date as Datetime
)
Returns varchar (30)
AS
BEGIN
Declare @Return varchar (30)
Select @Return=case datepart(dw,@Date)
When 1 Then 'Sunday'
When 2 Then 'Monday'
When 3 Then 'Tuesday'
When 4 Then 'Wednesday'
When 5 Then 'Thursday'
When 6 Then 'Friday'
When 7 Then 'Saturday' End
Return @Return
END
No hay comentarios:
Publicar un comentario