比较两个日期和报告中的下降 [英] comparing two dates and drop in report

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

问题描述



我的申请中有两个约会.安装日期和保修到期日期.
我想选择保修期内的日期并在报告中显示.
如何选择.请告诉我代码.

prerana



i have two dates in my application. installationdate and warrantyexpirydate.
i want to select the date which is under warranty and show it in report.
how to select it.tell me code please.

prerana

推荐答案

SELECT ApplicationName, InstallationDate, WarrantyExpirationDate
FROM MyApplications
WHERE (WarrantyExpirationDate <= GETDATE())


简单选择语句可以如下:

simple select statement can be as follows:

select * from table_name where getDate() between installationdate and warrantyexpirydate
or
select * from table_name where warrantyexpirydate >= getDate()


这篇关于比较两个日期和报告中的下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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