Use this function to get the Year of current Date:
datepart(yy,date)
Use this function to get the month of current Date:
datepart(mm,date)
Use this function to get the day of current Date:
datepart(dd,date)
Ex:
Select Datepart(dd,admissiondate) from Student;
This print the day of the date in the 'admissiondate' column
No comments:
Post a Comment