"amiya" <am******@rediffmail.com> wrote in message
news:cc**************************@posting.google.c om...
select last_name,hire_date,to_char(hire_date,'DAY') DAY
from employees
order by to_char(hire_date-1,'d')
i wanted to know how the function to_char(hire_date-1,'d') works...
its basically a query used to find the day on which a employee was
hired ,also it requires that the query be sorted by the day of the
week on which the employee was hired.
it'll be helpful is someone replies to this
to_char() is not a SQL Server function (I think it's Oracle, but I'm not
sure). Depending on what the query above is doing, this might be an MSSQL
equivalent, but I don't know what to_char() does, so I may be wrong:
select last_name, hire_date, datepart(dd, hire_date) as 'day'
from employees
order by datename(dd, hire_date)
Simon