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
21 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ssms - object execution statistics 12 37
Row-Level Security 2 20
Convert SP in a format for debugging 7 13
select over clause 1 10
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now