[已解决]将数据库中的varchar与系统日期相比较的日期进行比较? [英] [Solved] Comparing date which is stoared as varchar in database with system date?

查看:100
本文介绍了[已解决]将数据库中的varchar与系统日期相比较的日期进行比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据库中nvarchar的日期与系统日期进行比较。

我试图通过使用一些日期转换格式方法来解决问题。但是无法比较。该问题的解决方案是什么?

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?

推荐答案

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


这篇关于[已解决]将数据库中的varchar与系统日期相比较的日期进行比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆