| Author |
Topic |
|
TimR
Starting Member
9 Posts |
Posted - 2012-02-15 : 13:49:04
|
| I'm having trouble converting my date field, which has a data type of varchar(8), to a date format. My guess is I need to convert it into a new column in the table but I'm unsure how to do that. Thanks for any help! |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
TimR
Starting Member
9 Posts |
Posted - 2012-02-15 : 13:57:52
|
| Hi Brett -It does - there are about 16 million rows of data in the table, 176 are returned with your query. Is there anyway to keep the rows but skip them while converting?thanks,Tim |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
TimR
Starting Member
9 Posts |
Posted - 2012-02-15 : 14:11:54
|
| Success! Thank you so much, I've been banging my head against the wall on this one. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
TimR
Starting Member
9 Posts |
Posted - 2012-02-15 : 14:30:40
|
| Looks like they had eight spaces. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-03-17 : 13:59:38
|
| Check out the length tooUPDATE myTableSET NewdteCol = CONVERT(datetime,OlddteCol)WHERE ISDATE(OlddteCol) = 1 and len(OlddteCol)=8GOWant to know the reason?SELECT isdate(2000)MadhivananFailing to plan is Planning to fail |
 |
|
|
|