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 |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 04:38:10
|
| Hello there.I have two date variable one for 1st day in month before present.and one for last day in month before present.( SELECT DATEADD(month,datediff(month,0,getdate())-1,0)) ( select DATEADD(month,datediff(month,0,getdate()),0)-1 )the format come out like 2011-01-31 00:00:00.000how do i change to make the month come as follows2011-jan-31 00:00:00.000kind RegardsRobMCTS / MCITP certified |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-04 : 04:41:01
|
| Formation matters only if you want to show data somewhere. Where do you want to show data?MadhivananFailing to plan is Planning to fail |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 05:00:52
|
| ok how do i change the date formate from yyyy-mm-dd to dd-mm-yyyy |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 05:23:28
|
| no worries.done it!SELECT CONVERT(VARCHAR(20), dbo.USER DEFINED DATE FUNCTION(), 106) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-04 : 05:45:07
|
quote: Originally posted by masterdineen no worries.done it!SELECT CONVERT(VARCHAR(20), dbo.USER DEFINED DATE FUNCTION(), 106)
Note that the date values become varcharsMadhivananFailing to plan is Planning to fail |
 |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-02-04 : 06:14:02
|
| yes i have noticed that. |
 |
|
|
|
|
|