amrelgarhy81
asked on
SQL filter isdate ?
Hello,
I have a table in sql server database contains varchar field, in this field records there is some records contains valid date values and some records contains characters "not date value".
What i want is write a filter to get the records which contains the valid date values only.
Something like:
select * from MyTable where MyField IsDate
Thanks,
I have a table in sql server database contains varchar field, in this field records there is some records contains valid date values and some records contains characters "not date value".
What i want is write a filter to get the records which contains the valid date values only.
Something like:
select * from MyTable where MyField IsDate
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so, in a filter, you can then use that function as if it were a legitimate datetime ( not neccessarily recommended for very large tables ) as in
select * from mytable where isnull(dbo.uValidDate(myco lumn),'190 00101') between getdate() - 90 and getdate()
but then AngelIII's use of isdate probably answers your question...
select * from mytable where isnull(dbo.uValidDate(myco
but then AngelIII's use of isdate probably answers your question...
you will get different results of IsDate() based on that setting.