日期最接近今天的开放表格 [英] Open form where date is closest to today
本文介绍了日期最接近今天的开放表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试打开一个表单,其中字段的值具有最接近今天但不超过今天的日期。
我想我需要某种MAX函数在哪里可能是法案????
任何想法我怎么能做到这一点。
谢谢。
解决方案
SQL Gang可能会提出更好的解决方案,但下面的SQL语句将会产生表1中[TheDate]字段中最接近当前日期的日期,包括今天的日期,不超出当前日期:
展开 | 选择 | Wrap | 行号
ADzii的解决方案应该有效,但因为我不相信TOP给我一个特定的记录,我会使用这样的查询:
展开 | 选择 | Wrap < span class =codeDivider> | 行号
您的代码更好比我的代码,男孩,我讨厌SQL! (LOL)
I''m trying to open a form where the value of a field has a date closest to today but not beyond todays date.
I guess i need some sort of MAX function in a where statment maybe????
Any ideas how i could do this.
Thanks.解决方案The SQL Gang will probably come up with a better solution, but the following SQL Statement will produce the closest Date in the [TheDate] Field in Table 1 to the Current Date, including Today''s Date, without going beyond the Current Date:
Expand|Select|Wrap|Line Numbers
ADzii''s solution should work, but since I don''t trust "TOP" to give me a specific record, I would use a query like this:
Expand|Select|Wrap|Line Numbers
Your code is better than my code, boy do I hate SQL! (LOL)
这篇关于日期最接近今天的开放表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆