所选日期不应介于或等于fromdate和todate之间 [英] Selected date should not between or equal to fromdate and todate

查看:92
本文介绍了所选日期不应介于或等于fromdate和todate之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写oracle查询以检查所选日期不应介于或等于FromDate和ToDate之间





请确实需要完整



我的尝试:



'05 -jan-2018'NOT BETWEEN trunc(fromdate)AND trunc(todate)

解决方案

当你使用trunc我假设todate和fromdate是datetime而不是date。试试这个

 其中 to_date(2018-01-05,YYYY-MM-DD)> to_date(fromdate) AND  to_date(2018-01-05,YYYY-MM-DD)< TO_DATE(TODATE); 


How to write oracle query to check Selected date should not between or equal FromDate and ToDate


please do need full

What I have tried:

'05-jan-2018' NOT BETWEEN trunc(fromdate) AND trunc(todate)

解决方案

As you are using trunc I'm assuming that todate and fromdate are datetime rather than just date. Try this

where to_date(2018-01-05,YYYY-MM-DD) > to_date(fromdate) AND to_date(2018-01-05,YYYY-MM-DD) < to_date(todate);


这篇关于所选日期不应介于或等于fromdate和todate之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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