SQL Access 2007关于日期格式 [英] SQL Access 2007 about date formating

查看:54
本文介绍了SQL Access 2007关于日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在执行此查询后获得此结果.结果显示,仅显示那些将撤离建筑物且合同在数月后结束的人员.需要此查询才能查看所有将要离开的人.

例如- 2012年3月1日(必须在结束前30天)- 2012年3月31日合同结束日期

我的问题是使数据库自动化.

谁能帮我吗?

来自
Onke

I want to get this result after I perform this query. There outcome, to show only those who will evacuate the building with their contracts ending in months’ time. This query is needed to view all those who will be leaving soon.

E.G - 1 March 2012 (this must be 30 days before ending) - 31 March 2012 contract ending date

My problem is making this automating for the database.

Can anyone help me?

From
Onke

推荐答案

尝试:
SELECT * FROM myTable WHERE dateColumn BETWEEN '2012-3-1' AND DATEADD(day, 30, '2012-3-1')


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

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