Avatar of gpmsqldev
gpmsqldev
 asked on

Problem with Sorting...

Hi,

i have following values in day column.
Day
==
F
M
W
Th
Sa
Su
Tu

Each value in above column denotes F - Friday,  M-Monday, W-Wednesday, Th-Thursday, Sa-Saturday, Su-Sunday, Tu-Tuesday.

I want to sort those values by day... i.e)  M,Tu,W,Th,F.Sa,Su

Anyone please assist with me for this requirement...
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
gpmsqldev

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Daniel Wilson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Anthony Perkins

You could also use a Computed Column to "translate" the code to a more useful tinyint...
gpmsqldev

ASKER
Its helps me to solve my problem... but i am not using this method . Anyway we have to use M as 1, and Tu as 2, and so on....

So i used CASE statement for this problem.. and finally sorted correctly..
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck