Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
learntsql
524 Posts |
Posted - 2014-04-02 : 08:29:51
|
Hi All,I have to display Week date for each month like monthno/dayfor example, for April the starting week value should be as 04/01 (Tuesday) and next week values as04/06 (Sunday)04/1304/2004/27and in may it should display startin week value as 05/01 (Thursday)and05/0405/11 and so on...Can some one please guide me how to get this format using SQL server 2008 R2 version.Thanks a lot in advance. |
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2014-04-02 : 08:48:24
|
First you should uses a front end to format.SELECT CONVERT(VARCHAR(5),GETDATE(),1) djj |
|
|
sqlsaga
Yak Posting Veteran
93 Posts |
Posted - 2014-04-02 : 17:50:28
|
I believe having a calendar table would be very useful for your scenario. Read an article I wrote on how to create the calendar table between desired dates @ http://sqlsaga.com/sql-server/script-to-populate-date-dimension/Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles. |
|
|
|
|
|