Solved

I want to extract the Actual day, for example Fri for 22/07/2016, from a DateTime field in SQL

Posted on 2016-07-22
5
29 Views
Last Modified: 2016-10-01
I have tried CONVERT and looked at Date and Time Styles in SQL but I cannot see any that will output "DDD" as you can in Excel.


SELECT     call_date AS DateRaised, CONVERT(VARCHAR(30), call_date, 106) AS 'Day',
calltype, CallOutNo,
FROM         dbo.vw_CallsInByDay_01
WHERE     (DATEPART(YEAR, call_date)) = 2016
0
Comment
Question by:CMChalcraft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 41724441
Select datename(dw, getdate())
0
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 41724444
If you just wwant the short name, you can return the left 3 chars:

select left(datename(dw, getdate()), 3)

Open in new window

0
 

Author Comment

by:CMChalcraft
ID: 41724473
Very good. Thanks for the speedy response.

Regards

Chris C
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 41739157
Hopefully it helped?

Thanks.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

617 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