2. How to show only last 2 digit of year while selecting any date
In SQL Server 2008 another one datatype is present called "date" which only stores the date. While selecting date we generally get date in MM/DD/YYYY format. Using following query we can get date in MM/DD/YY format only.
EX: SELECT CONVERT(VARCHAR, DATE_OF_BIRTH,1) FROM TABLE_NAME
3. How to get day of a particular date
Sometimes we need date and its corresponding day.Following query helps us in achieving that.
EX: SELECT DATENAME(WEEKDAY, CLASS_START_DATE) FROM TABLE_NAME