TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
selva kumar
NA
557
189k
how to sort the date in dd mm yyyy
May 11 2013 3:18 AM
This is my code:
create table [sample](T_id int identity(1,1),date varchar(50));
insert into [sample] values('04-05-2013');
insert into [sample] values('07-03-2013');
insert into [sample] values('10-01-2013');
insert into [sample] values('20-08-2013');
insert into [sample] values('18-02-2013');
insert into [sample] values('09-07-2013');
insert into [sample] values('07-06-2013');
insert into [sample] values('05-12-2013');
insert into [sample] values('05-12-2013');
insert into [sample] values('05-12-2013');
if i m using below query:
select distinct Convert(datetime,date,105)as date from [sample] order by date desc;
im getting this out put:
2013-12-05 00:00:00.000
2013-08-20 00:00:00.000
2013-07-09 00:00:00.000
2013-06-07 00:00:00.000
2013-05-04 00:00:00.000
2013-03-07 00:00:00.000
2013-02-18 00:00:00.000
2013-01-10 00:00:00.000
this is my problem......
i want to get the out put like this
05-12-2013
20-08-2013
09-07-2013
07-06-2013
04-05-2013
07-03-2013
18-02-2013
10-01-2013
How do i Get This ...help Me...i am trying past two days.....help me quickly..........
Reply
Answers (
24
)
Why did non clustered index increase cost?
How to add new column b/w two existing columns in sql ?