Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to compare the date which is stoared as nvarchar in database with the sytem date .
I have tried to solve the problem by using some date conversion format methods.but not able to compare . What will be the solution for the problem?
Posted
Updated 25-Mar-14 23:23pm
v2
Comments
Tharaka MTR 28-Feb-14 0:52am    
What is your system date format? you need to use the correct conversion depending on that.

1 solution

SQL
select CONVERT(datetime, (RIGHT(LEFT(datecolumn,5),2) + '/'+LEFT(datecolumn,2)+'/'+ RIGHT(LEFT(datecolumn,10),4)+ SUBSTRING(datecolumn,11, len(datecolumn))), 120) as datefield

FROM DatesTable


Try this.I Hope this may help you
 
Share this answer
 
Comments
Ni!E$H_WAGH 28-Feb-14 0:50am    
Thank you sir .
Blesson Mathew 28-Feb-14 1:07am    
if it is working .thenm please mark it as answer and give rating .Thats help others too.

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