Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Help to solve: date is incompatible with int

$
0
0

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


Viewing all articles
Browse latest Browse all 7129

Trending Articles