我试图提取超过凌晨5点的查询... [英] I am trying to pull a query for times greater than 5am...

查看:54
本文介绍了我试图提取超过凌晨5点的查询...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我用以下参数提取查询...


日期字段(格式化为短日期)

for some reason when i pull my query with the following parameters...


Date field (formatted to short date)

展开 | 选择 | Wrap | 行号

推荐答案

sooli,


尽量记住日期是整数和时间是整数的分数。所以,早上5点实际上是0.208333。


要计算时间,最好的方法是使用DateAdd()函数。因此,要确定上午5:00的日期,您将采用日期(确保使用 DATE 而不是 DateTime )并添加5小时:

sooli,

Try to keep in mind that Dates are integers and times are fractions of integers. So, 5:00 am is actually 0.208333.

To calculate times, the best method is to use the DateAdd() Function. So, to determine a date at 5:00 am, you would take the date (be sure to use a DATE and not a DateTime) and add 5 hours:

展开 | 选择 | Wrap | 行号


另外,如果参数始终是昨天的日期,则无需提示为了它。你可以减去当前日期的一天。


顺便说一句,因为你没有显示日期部分并不意味着它不存在于数据。 #5:00 AM#隐藏日期部分为12/30/1899。


和小时(5)获取值#01/04/1900 00的小时: 00:00 AM#等于0。
Also, if the parameter is always yesterday''s date, there''s no need to prompt for it. You can subtract one day from the current date.

By the way, just because you''re not displaying the date portion doesn''t mean it''s not there in the data. #5:00 AM# has a hidden date portion of 12/30/1899.

And Hour(5) is getting the hour of the value #01/04/1900 00:00:00 AM# which is equal to 0.


谢谢!这非常有效!你摇滚!
THANK YOU! This worked perfectly! You rock!


这篇关于我试图提取超过凌晨5点的查询...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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