Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / April 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mitchell_Collen - 28 Apr 2008 21:24 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.