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 |
|
ratcho
Starting Member
18 Posts |
Posted - 2002-08-28 : 16:52:40
|
| Please help me with the following problem:getdate() gives me this:Aug 28 2002 4:49PMNow, I need the date in the following format:20020828164959(including seconds)I have already tried convert(char, getdate(), 112)but the result doesn't include the hours, minutes and secondsThanks a lot for your time |
|
|
joshb
Yak Posting Veteran
52 Posts |
Posted - 2002-08-28 : 17:03:05
|
| I'm sure there are many different ways to do this, here's one:select convert(varchar, getdate(), 112) + replace(convert(varchar, getdate(), 108),':','') |
 |
|
|
ratcho
Starting Member
18 Posts |
Posted - 2002-08-28 : 17:14:24
|
| Thanks a lot, it's perfect |
 |
|
|
|
|
|