text: ---------------------------------------------------------------------
  -- LAB 06
  --
  -- Exercise 1
  ---------------------------------------------------------------------
  
  USE TSQL;
  GO
  
  ---------------------------------------------------------------------
  -- Task 1
  -- 
  -- 
  -- Write a SELECT statement to return columns that contain:
  --  The current date and time. Use the alias currentdatetime.
  --  Just the current date. Use the alias currentdate.
  --  Just the current time. Use the alias currenttime.
  --  Just the current year. Use the alias currentyear.
  --  Just the current month number. Use the alias currentmonth.
  --  Just the current day of month number. Use the alias currentday.
  --  Just the current week number in the year. Use the alias currentweeknumber.
  --  The name of the current month based on the currentdatetime column. Use the alias currentmonthname.
  -- 
  -- Execute the written statement and compare the results that you got with the desired results shown in the file 52 - Lab Exercise 1 - Task 1 Result.txt. Your results will be different because of the current date and time value.
  --
  -- Can you use the alias currentdatetime as the source in the second column calculation (currentdate)? Please explain.
  ---------------------------------------------------------------------
  
  
  
  ---------------------------------------------------------------------
  -- Task 2
  --  
  -- Write December 11, 2015, as a column with a data type of date. Use the different possibilities inside the T-SQL language (cast, convert, specific function, etc.) and use the alias somedate.
  ---------------------------------------------------------------------
  
  
  ---------------------------------------------------------------------
  -- Task 3
  -- 
  -- Write a SELECT statement to return columns that contain:
  --  Three months from the current date and time. Use the alias threemonths.
  --  Number of days between the current date and the first column (threemonths). Use the alias diffdays.
  --  Number of weeks between April 4, 1992, and September 16, 2011. Use the alias diffweeks.
  --  First day in the current month based on the current date and time. Use the alias firstday.
  --
  -- Execute the written statement and compare the results that you got with the desired results shown in the file 53 - Lab Exercise 1 - Task 3 Result.txt. Some results will be different because of the current date and time value.
  ---------------------------------------------------------------------
  
  
  ---------------------------------------------------------------------
  -- Task 4
  -- 
  -- The IT department has written a T-SQL statement that creates and populates a table named Sales.Somedates. 
  --
  -- Execute the provided T-SQL statement.
  -- 
  -- Write a SELECT statement against the Sales.Somedates table and retrieve the isitdate column. Add a new column named converteddate with a new date data type value based on the column isitdate. If the column isitdate cannot be converted to a date data type for a specific row, then return a NULL. 
  --
  -- Execute the written statement and compare the results that you got with the desired results shown in the file 54 - Lab Exercise 1 - Task 4 Result.txt. 
  -- 
  -- What is the difference between the SYSDATETIME and CURRENT_TIMESTAMP functions?
  --
  -- What is a language-neutral format for the DATE type?
  ---------------------------------------------------------------------
  
  SET NOCOUNT ON;
  
  DROP TABLE IF EXISTS Sales.Somedates;
  
  CREATE TABLE Sales.Somedates (
  	isitdate varchar(9)
  );
  
  INSERT INTO Sales.Somedates (isitdate) VALUES 
  	('20110101'),
  	('20110102'),
  	('20110103X'),
  	('20110104'),
  	('20110105'),
  	('20110106'),
  	('20110107Y'),
  	('20110108');
  
  SET NOCOUNT OFF;
  
  SELECT isitdate
  FROM Sales.Somedates;
  
  
  
  
  
  ---------------------------------------------------------------------
  -- Task 5
  -- 
  -- copy-paste text about lab from doc file
  ---------------------------------------------------------------------
  -- drop the table 
  
  DROP TABLE Sales.Somedates;