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 - 2010-01-05 : 05:51:16
|
| Hi..I want to display like <NameField>+' '+01 JanI tried as followsSELECT 'Name'+' '+CONVERT(VARCHAR(100),DAY(GetDate()))+' '+DATEPART(Month,GetDate())but am getting conversion problem?And how to display MonthName if i get monthNumber.help me. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-05 : 05:53:24
|
| DATEPART's return type is int thats why problem. use DATENAME() instead which will give you varchar value |
 |
|
|
learntsql
524 Posts |
Posted - 2010-01-05 : 05:56:10
|
| Thank you. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-06 : 03:18:18
|
welcome |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-01-06 : 03:31:18
|
| SELECT 'Name'+' '+CONVERT(VARCHAR(6),GetDate(),106)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|