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 |
krathbun
Starting Member
2 Posts |
Posted - 2014-11-24 : 13:11:02
|
I have a column that is VARCHAR(30) this column is supposed to contain values that "look" like a date in the form mm/dd/yyyy - however because it is a free-text character field often times data is entered other then a date -- "text" -How do I return only the data that is in the format of mm/dd/yyyyMSSQL 2012Karen Rathbun |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-11-24 : 13:12:15
|
You can use the ISDATE function.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
krathbun
Starting Member
2 Posts |
Posted - 2014-11-24 : 13:32:23
|
OK - ISDATE does give me a 1 or 0(if not a date) -- how do I then return the actual data for when the statement is true?Karen Rathbun |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-11-24 : 14:13:57
|
select datetimecolumn fromyourtable where isdate(datetimecolumn) = 1Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|