?
Solved

Try to return day of the week

Posted on 2011-09-14
3
Medium Priority
?
202 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

850 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