Hi everyone,
I'm having trouble with an order by statement where my date is in text format. I've attempted the following but it wouldn't produce the correct results:
Select user, mid(startdt, 3,2) & '/' & right(startdt,2) & '/' & left(startdt, 2) as Start
from Employee
order by cdate(mid(startdt, 3,2) & '/' & right(startdt,2) & '/' & left(startdt, 2)) desc, user;
Data i have is:
Marc, 060423
Bryan, 100515
Anita, 090127
Kevin, 090424
Gloria, 100512
Results expected are:
Bryan 05/15/10
Gloria 05/12/10
Kevin 04/24/09
etc
Results I currently get are:
Gloria 05/12/10
Bryan 05/15/10
Marc 04/23/06
Kevin 04/24/09
Any help is appreciated.
I'm having trouble with an order by statement where my date is in text format. I've attempted the following but it wouldn't produce the correct results:
Select user, mid(startdt, 3,2) & '/' & right(startdt,2) & '/' & left(startdt, 2) as Start
from Employee
order by cdate(mid(startdt, 3,2) & '/' & right(startdt,2) & '/' & left(startdt, 2)) desc, user;
Data i have is:
Marc, 060423
Bryan, 100515
Anita, 090127
Kevin, 090424
Gloria, 100512
Results expected are:
Bryan 05/15/10
Gloria 05/12/10
Kevin 04/24/09
etc
Results I currently get are:
Gloria 05/12/10
Bryan 05/15/10
Marc 04/23/06
Kevin 04/24/09
Any help is appreciated.