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 |
|
b00gieman
Starting Member
14 Posts |
Posted - 2007-11-30 : 02:30:50
|
| Hi!Is it possible to convert a 'dd.mm.yyyy' string into an mm/dd/yyyy date using convert or cast?The date format set on the sql server is mm/dd/yyyy...Thanks! |
|
|
arorarahul.0688
Posting Yak Master
125 Posts |
Posted - 2007-11-30 : 02:49:16
|
| this will work chk it outselect convert(varchar(15),column_name,101) from tablekenw.............Rahul Arora MCA 07 BatchNCCE Israna, PanipatHRY, INDIA######################IMPOSSIBLE = I+M+POSSIBLE |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-30 : 03:20:19
|
quote: Originally posted by b00gieman Hi!Is it possible to convert a 'dd.mm.yyyy' string into an mm/dd/yyyy date using convert or cast?The date format set on the sql server is mm/dd/yyyy...Thanks!
1 What is the datatype of the column?2 Where do you want to show formatted dates?MadhivananFailing to plan is Planning to fail |
 |
|
|
b00gieman
Starting Member
14 Posts |
Posted - 2007-11-30 : 08:31:22
|
| It's like this:I have an intermediary sql table.I'm importing excel data into this table.My problem is that the date in the excel has the 'dd.mm.yyyy' type.I want to us my intermediary table to update another table.In the other table,the format is 'mm/dd/yyyy'... |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-30 : 10:01:48
|
quote: In the other table,the format is 'mm/dd/yyyy'...
Don't tell me the data type for "the other table" is also varchar ?The data type of "the other table" should datatime. You can use convert(datetime, stagingtable.datecol, 103) to convert to datetime KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
b00gieman
Starting Member
14 Posts |
Posted - 2007-11-30 : 14:13:57
|
| no,the other table,the data type is 'smalldatetime'...thx for the suggestion.I'll try that... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-01 : 01:21:01
|
| also check if you have any bad dateswhere isdate(col)=1 and len(col)=10MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|