验证日期/时间之间的预订 [英] Validating a Booking between Date/Times

查看:86
本文介绍了验证日期/时间之间的预订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

恐怕我回到了一个我认为已经解决的旧问题。我现在正在进行UAT测试并且发现我的SQL语句的逻辑不起作用。


我在表中有以下记录并且想要编辑记录并在之前验证更改保存它。这是qryBookings的结果,我的Dcount函数评估了SQL。

I am afraid I am back to an old question which I thought I had resolved. I am now UAT testing and have found that the logic of my SQL statement does not work.

I have the following records in a table and want to edit a record and validate the change before saving it. This is the result of the qryBookings that my Dcount function evaluates the SQL against.

展开 | 选择 | Wrap | 行号

推荐答案

两者都正确无效。


在第一种情况下,记录1在下午1:30的结束时间不在记录2的开始时间下午1:30之前。它们重叠在1毫秒到59.999秒之间。


在第二种情况下,记录3'的新开始和结束时间为凌晨1:30到下午5:30重叠记录2'的开始和结束时间为下午1:30到下午6:30。


代码正常工作。
Both are correctly invalid.

In the first case, the end time of record 1 at 1:30 PM is not before the start time of record 2 at 1:30 PM. They overlap by anywhere between 1 millisecond to 59.999 seconds.

In the second case, record 3''s new start and end time of 1:30 AM to 5:30 PM overlaps with record 2''s start and end time of 1:30 PM to 6:30 PM.

The code is working as it should.


Ok Rabbit,这让我崛起。我现在已将< =和> =添加到条件中,因为我希望能够在时间=时预订房间,因此我在预订时以10Am结束,而在另一个时间以10Am开始。


这是当前表: -

Ok Rabbit, this is driving me up the wall. I have now added <= and >= to the condition as I would like to be able to book a room when times = so End at 10Am for i booking and Start at 10Am for another.

Here is the current Table:-


展开 | 选择 | Wrap < span class =codeDivider> | 行号


什么是代码看起来像现在?
What''s the code look like now?


这篇关于验证日期/时间之间的预订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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