Sometimes, a client may need to sort the result of a query by a date element (year, month, or day)
Engineeing provided an example which involved the use of the DATEPART function
IMPORTANT - The DATEPART function can only deal with ONE date element at a time (year, month, or day)
 The default sort in an SQL query report is in ascending order , and there is no need to use the keyword ASC. If ASC is used, it really does nothing.
 To have a result sorted in descending order, the keyword DESC should be affixed to the end of the SORT BY clause.
The use of the DATEFORMAT function as in SQL 2Â below separates the time component from the date.
SQL 1 ... Use this SQL script to sort Positions Fill_Date by year:
select pno, fill_date from positions order by datepart(year,fill_date)
SQL 2. ...  Use this query to sort by year and to separate the time component from the date: select pno, date(fill_date)"Date Filled" from positions where fill_date is not null order by date(fill_date)