Link to home
Create AccountLog in
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...
ASKER CERTIFIED SOLUTION
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Anthony Perkins
You could also use a Computed Column to "translate" the code to a more useful tinyint...
Avatar of gpmsqldev
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..