Solved

Try to return day of the week

Posted on 2011-09-14
3
192 Views
Last Modified: 2012-06-21
I would like to add a column that shows what is the weakday like Mon, Tues, Wed and so on...
based on the date that i have in another colum:
Here is what i have:

TimeStamp                                  Name
2011-06-20 22:59:47.050             KPI-X
2011-06-22 22:59:47.050             KPI-M
2011-06-25 22:59:47.050             KPI-I

So all what i want to do is add another column that shows weather it is Monday or Tues so forth based on TimeStamp date.  thanks for your help      
0
Comment
Question by:karinos57
3 Comments
 
LVL 3

Accepted Solution

by:
anjos earned 500 total points
ID: 36536957
This should do it:

DATENAME(dw, Your_Date_Column)
0
 

Author Closing Comment

by:karinos57
ID: 36537007
thnx
0
 
LVL 42

Expert Comment

by:dqmq
ID: 36537013
alter table Yourtable add DayOfWeek as datename(dw,[timestamp])
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question