在其他表格的两个日期之间选择日期 [英] Select Date between two dates in other table

查看:81
本文介绍了在其他表格的两个日期之间选择日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

资深专家


我有一个表,EntryDate和Amount是该表的字段.
并且我还有另一个表具有开始日期"和结束日期".

第一张表-EntryDate,amount
第二张表-FromDate,ToDate,IsActive

我需要从第一个表获得的入口日期而不是第二个表fromdate和todate之间的金额.

我的示例查询是


Hi Exeperts


I have one table, EntryDate and Amount are the fields of this table.
and I have another table has From Date and End date.

First Table - EntryDate,amount
Second Table - FromDate,ToDate,IsActive

I need to get amount where entrydate from first table not between the second table fromdate and todate.

My sample query is


select sum(amount) from FirstTable where entrydate is not between (select FromDate,ToDate from SeconTable)




我如何获得此查询

请这是我急需的

请尽快向我发送查询

谢谢&问候

Justin Diraviam




How can i get this query

Please this is my urgent needed

Please send me the queries as soon as possible

Thanks & Regards

Justin Diraviam

推荐答案

您可以尝试类似
的方法
You could try something like
select sum(amount) 
from FirstTable 
where entrydate is not between (select FromDate from SeconTable)
                       and     (select ToDate from SeconTable)


这篇关于在其他表格的两个日期之间选择日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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