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 |
|
vpathisseril
Starting Member
6 Posts |
Posted - 2003-10-29 : 13:37:15
|
| I am trying to convert a date formats:Date to MMDDYYYYI know how to convert to YYYYMMDD as follows.select (convert(char(8), p.check_date,112)) from tempoutput:YYYYMMDD20030912I want my out should be MMDDYYYYAny suggestions greatly appreciated.Thanks |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2003-10-29 : 13:44:03
|
| select replace(convert(varchar(10),getdate(),101),'/','') |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-10-29 : 13:48:03
|
[code]DECLARE @x varchar(26), @y varchar(26)SELECT @x=CONVERT(varchar(26), GetDate(), 112)SELECT @y = SUBSTRING(@x,5,2)+SUBSTRING(@x,7,2)+SUBSTRING(@x,1,4)SELECT @y[/code]I like his better...by far...Brett8-) |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2003-10-29 : 13:52:05
|
| There goes brett trying to up his posts again. LOLJimUsers <> Logic |
 |
|
|
|
|
|
|
|