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

Signature
Misty :-)
Sylvain Lafontaine - 28 Apr 2008 21:47 GMT
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.

Signature
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
> Hi all.
> I have create a form with a chart that pulls data from an aggregated view.
[quoted text clipped - 16 lines]
>
> Thanks in advance! Misty