Click here to Skip to main content
15,885,940 members
Please Sign up or sign in to vote.
2.41/5 (3 votes)
See more:
Do we any command or function in SQL which identifies that the given column or value is a date or not.
Posted
Comments
PIEBALDconsult 14-Nov-14 9:45am    
0) Don't store dates as strings.
1) If SQL Server 2008+ -- ISDATE http://msdn.microsoft.com/en-us/library/ms187347.aspx
2) LIKE '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
3) Beyond that, you can try converting it and catching an error, but that's unlikely to be the best option.
Shweta N Mishra 14-Nov-14 10:01am    
got the solution already, thanks everyone.
Shweta N Mishra 14-Nov-14 10:03am    
i clicked on I'hav solved this myself button and it took me there, and i deleted the answer after realizing it. thanks
Sergey Alexandrovich Kryukov 14-Nov-14 12:05pm    
Why? why?!
—SA

1 solution

Here you go[^] first thing on google.

You should do some research before coming to ask the questions.
If this helps please take time to accept the solution. Thank you.
 
Share this answer
 
Comments
Shweta N Mishra 14-Nov-14 10:01am    
got the solution already, thanks everyone.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900