日期比较范围 [英] Date compare in a range

查看:111
本文介绍了日期比较范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个日期,比如说Expdate1和Expdate2。

我需要查看ExpDate2是在Expdate1的6个月之前还是之后发现。

我该如何使用sql server 2008.

请帮我解决这个问题。

I have two dates, say Expdate1 and Expdate2.
I need to find whether ExpDate2 comes before or after 6 months of Expdate1.
How can I do this using sql server 2008.
Please help me to solve this.

推荐答案

你可以使用SQL Server DATEADD()函数 [ ^ ]。如果您遇到任何问题,请尝试并告诉我们。
You can use SQL Server DATEADD() Function[^] for this. Try it and let us know if you face any issue.


这篇关于日期比较范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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