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 |
Stas
Starting Member
1 Post |
Posted - 2006-08-10 : 21:04:27
|
How to get a list of dates in ‘mm/yyyy’ format for particular period of time. In example: DATENAME(DATEPART(MM, mStartDate)) + "/" + DATENAME(DATEPART(YYYY, mStartDate)) to GETDATE() where mStartDate will be 01/02/2005MSSQL 2005Thank you |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-08-10 : 21:31:05
|
You can use the function in the link below to get a list of dates in many different formats for any range of dates you chose.select DATE, DATE_FORMAT_MM_DD_YYYY, MM_YYYY = left(DATE_FORMAT_MM_DD_YYYY,2)+ right(DATE_FORMAT_MM_DD_YYYY,5)from dbo.F_TABLE_DATE('20060101','20061231')order by DATE Date Table Function F_TABLE_DATEhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519CODO ERGO SUM |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-11 : 13:01:04
|
Also,http://weblogs.sqlteam.com/derrickl/archive/2005/01/08/3959.aspxIf you use front end application, use format function thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|