时间和日期的麻烦 [英] Time and date trouble

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

问题描述

HI全部,

我是新手(我也没有vb pro),SOooo Im陷入了一个项目!在这里它


我有两张桌子

1房间

------------ ---------(保留房间详情)

房间没有

房间类型


2预订

--------------------(持有预订)

房间号

开始日期

开始时间

结束日期

结束时间


来自此我喜欢预订详情大部分未保留详情

喜欢:如果预订房间

2007/06/05 12:00至2007/06/07 13:00

这个房间在serch查询结果中没有显示(如果我在2007/06/05 /任何时间到2007/06/06任何时候都可以获得免费roms




请bsomebody帮助

解决方案

我试过这个


选择房间否

从房间

房间没有房间(

选择房间没有预订

哪里[SDate] + [Stime]之间[ssdate] + [sstime ]和[dddate] + [ddtim e]);


但问题是它适用于日期但它不会计算时间


问题是什么?


我试过这个


选择房间否

FROM Rooms

WHERE RoomNo不在(

选择RoomNo from Reservation

其中[SDate] + [Stime]在[ssdate] + [sstime]和[dddate之间] ] + [ddtime]);


但事情是它适用于日期但它不会计算时间


问题是什么?



如果将时间留空,则无法正确计算。输入[sstime]为0:00,[ddtime]输入为23:59。

或将SQL更改为

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号



如果将时间留空,则无法正确计算。输入[sstime]为0:00,[ddtime]输入为23:59。

或将SQL更改为

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号


HI All,
Im new to access(and im no vb pro too), SOooo Im stuck in a project!! here it goes

I have a two tables
1 Rooms
---------------------(holds room details)
Room no
Room type

2 Reservation
--------------------(Holds reservation)
Room No
Start Date
Start Time
End Date
End Time

from this i like get the reservation detail mostly notreserved details
like: if a room reserved
2007/06/05 12:00 to 2007/06/07 13:00
this room shuold not apear in the serch query results (if i serched for free roms
between 2007/06/05/ any time to 2007/06/06 any time

please bsomebody help

解决方案

I tried this

SELECT Room No
FROM Rooms
WHERE RoomNo Not In (
Select RoomNo from Reservation
Where [SDate] + [Stime] Between [ssdate] + [sstime] And [dddate] + [ddtime]);

But the thing is it works with the date but it wont calculate time

whats the problem??


I tried this

SELECT Room No
FROM Rooms
WHERE RoomNo Not In (
Select RoomNo from Reservation
Where [SDate] + [Stime] Between [ssdate] + [sstime] And [dddate] + [ddtime]);

But the thing is it works with the date but it wont calculate time

whats the problem??

If you leave the time blank, it will not calculate correctly. Enter [sstime] as 0:00 and [ddtime] as 23:59.
or change your SQL to

Expand|Select|Wrap|Line Numbers


If you leave the time blank, it will not calculate correctly. Enter [sstime] as 0:00 and [ddtime] as 23:59.
or change your SQL to

Expand|Select|Wrap|Line Numbers


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

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