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 |
kishoremcp
Starting Member
41 Posts |
Posted - 2013-10-08 : 02:06:35
|
Hi, I have the below query to convert my date to 201302 (YYYYMM).REPLACE(RIGHT(CONVERT(VARCHAR(9), Open_Date_Month_Key, 6), 6), ' ', '-') as Month_keyI want it as Feb-13. (Month-YY)Can anybody extend the existing query to get the required result.RegardsKishore |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-08 : 06:07:21
|
Does the existing query already give you that?See this illustrationSELECT REPLACE(RIGHT(CONVERT(VARCHAR(9), GETDATE(), 6), 6), ' ', '-') as Month_keyoutput--------------Oct-13 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2013-10-08 : 07:01:57
|
we need to know the data type and an example value for Open_Date_Month_Key Too old to Rock'n'Roll too young to die. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-10-08 : 08:01:13
|
Also if you want to show the result in front end application, do this formation thereMadhivananFailing to plan is Planning to fail |
|
|
|
|
|