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 |
|
adamsm28
Starting Member
5 Posts |
Posted - 2007-12-03 : 08:02:00
|
| Hi, I need to convert getdate() to the following format:mmhhddmmyyyyCould one of you gurus please advise?Many thanks!Mark A |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-03 : 08:10:41
|
quote: Originally posted by adamsm28 Hi, I need to convert getdate() to the following format:mmhhddmmyyyyCould one of you gurus please advise?Many thanks!Mark A
Where do you want to show the converted dates?MadhivananFailing to plan is Planning to fail |
 |
|
|
adamsm28
Starting Member
5 Posts |
Posted - 2007-12-03 : 08:12:38
|
| I need to pass it to a var so that I can pass the datetime stamp to a file name e.g. "mmhhddmmyyyy<somestring>.dat" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-03 : 08:33:46
|
| [code]select substring(convert(varchar(10), getdate(),108),4,2)+ substring(convert(varchar(10), getdate(),108),1,2)+ replace(convert(varchar(10), getdate(),103),'/','')[/code]MadhivananFailing to plan is Planning to fail |
 |
|
|
adamsm28
Starting Member
5 Posts |
Posted - 2007-12-03 : 08:38:37
|
| Wow - you are the man!thanks! Saved me hours of sweat.BRMark |
 |
|
|
|
|
|
|
|