Created
February 16, 2022 11:05
-
-
Save James-McNeill/01895e8cd8e16fda926019e58ca21ffc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @date1 NVARCHAR(20) = '30.03.2019'; | |
-- Set the language | |
SET LANGUAGE 'Dutch'; | |
SELECT | |
@date1 AS initial_date, | |
-- Check that the date is valid | |
ISDATE(@date1) AS is_valid, | |
-- Select the name of the month | |
DATENAME(MONTH, @date1) AS month_name; | |
GO | |
DECLARE @date1 NVARCHAR(20) = '12/18/55'; | |
-- Set the language | |
SET LANGUAGE 'English'; | |
SELECT | |
@date1 AS initial_date, | |
-- Check that the date is valid | |
ISDATE(@date1) AS is_valid, | |
-- Select the week day name | |
DATENAME(WEEKDAY, @date1) AS week_day, | |
-- Extract the year from the date | |
YEAR(@date1) AS year_name; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment