Re: Please help me format the day of week using Transact-SQL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Data Type nvarchar or varchar
    ... Sylvain Lafontaine, ing. ... sylvain aei ca (fill the blanks, no spam please) ... Varchar is just about half the size of Nvarchar. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Data Type nvarchar or varchar
    ... Sylvain Lafontaine, ing. ... sylvain aei ca (fill the blanks, no spam please) ... Varchar is just about half the size of Nvarchar. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Run Time Error 7965 when displaying recordset
    ... Sylvain Lafontaine, ing. ... sylvain aei ca (fill the blanks, no spam please) ... was captured in SQL Profiler and run in SQL Management Studio it ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Data Type nvarchar or varchar
    ... There is more in life and in database than just trying to save a few bytes ... Sylvain Lafontaine, ing. ... sylvain aei ca (fill the blanks, no spam please) ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Upsizing wizard access Sql Server express
    ... Sylvain Lafontaine, ing. ... sylvain aei ca (fill the blanks, no spam please) ... database into sql server express 2005 by using the upsizing wizardi ...
    (microsoft.public.access.adp.sqlserver)