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
25 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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