I create this function to return info about weekday, but something is wrong...
CREATE FUNCTION dbo.D_Order ( @p_date [int] )RETURNS [int]
AS
BEGIN
DECLARE @d DATE = '2018-7-13';
SELECT @d = DATEPART(weekday, @d)
RETURN (@d)
END;
GO
I create this function to return info about weekday, but something is wrong...
CREATE FUNCTION dbo.D_Order ( @p_date [int] )