How to use DATEDIFF for 2 strings in SQL SERVER?

I have 2 column in a table which datatype is varchar. But I have stored the values as dates like 14/10/2016. Now I need find the month differents for those 2 column column . I am not able to use the datediff for this because column declared as varchar. Is there is any way to find the difference?

Answer:

Try this Query

select DATEDIFF(month,convert(datetime,date1),
convert(datetime,date2)) from XXX

Post a Comment

0 Comments