Re: Please help me format the day of week using Transact-SQL
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Mon, 28 Apr 2021 16:47:52 -0400
Use the Case Statement:
Select ... Case DAY(TxDatetime)
when 1 then N'mon'
when 2 then N'tue'
when 3 then N'wed'
when 4 then N'thur'
when 5 then N'fri'
when 6 then N'sat'
when 7 then N'sun'
End as DayOfWeek, ....
Also, this kind of question would be best answered in a newsgroup dedicated
to T-SQL such as microsoft.public.sqlserver.programming.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Mitchell_Collen via AccessMonster.com" <u33726@uwe> wrote in message
news:835e80e98e152@xxxxxx
Hi all.
I have create a form with a chart that pulls data from an aggregated view.
The the values are grouped by day of week. For instance, 1,2,3,4,5,6,7 The
problem is that that I need it to only read as mon, tue,wed, thur, fri
,sat,
sun
Is there a way to format the dates like this in a chart form by using
transact - sql?
here is my view:
SELECT Station, COUNT(TxDatetime) AS Total, DAY(TxDatetime) AS Day,
PaType
FROM dbo.phmPYXHx
WHERE (TxDatetime >= { fn NOW() } - 8) AND (PaType IN (N'LOADED',
N'REFILLED', N'RESTOCKED'))
GROUP BY Station, DAY(TxDatetime), PaType
Thanks in advance! Misty
--
Misty :-)
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-adp-sqlserver/200804/1
.
- References:
- Please help me format the day of week using Transact-SQL
- From: Mitchell_Collen via AccessMonster.com
- Please help me format the day of week using Transact-SQL
- Prev by Date: Please help me format the day of week using Transact-SQL
- Next by Date: Re: LINKING TO AN SQL SERVER 2005 DB THROUGH ACCESS 2007
- Previous by thread: Please help me format the day of week using Transact-SQL
- Index(es):
Relevant Pages
|