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 |
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2010-09-17 : 08:46:35
|
I want Month and Year in Datetime field.Result------1. 09-20102. 092010V.NAGARAJAN |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2010-09-17 : 08:48:10
|
why would you want to do this? |
 |
|
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2010-09-17 : 08:49:26
|
Cutomer Needs thisquote: Originally posted by sakets_2000 why would you want to do this?
V.NAGARAJAN |
 |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2010-09-17 : 08:55:38
|
your select to display that format can beselect convert(month(column),varchar(2))+convert(year(column),varchar(4)) from table |
 |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2010-09-17 : 08:57:28
|
You'd need to add in a case statement to above if you want leading zeroes to month part. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-17 : 12:18:54
|
quote: Originally posted by itnagaraj Cutomer Needs thisquote: Originally posted by sakets_2000 why would you want to do this?
V.NAGARAJAN
is it for display purposes?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|