现在()

编程入门 行业动态 更新时间:2024-10-19 05:18:40
本文介绍了现在()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在子表中有一些sql,它在表中找到日期,但仅当 日期小于今天 WHERE [MonthYear]<现在() 我希望它能做到这一点但不包括当前月份。 例如,dd中的日期列表/ mm / yy格式 1/01/05 01/02/05 等 等 01/11/05 01/12/05 01/01/06 01/02 / 06 如果我今天(11/01/06)01/01/06运行这个结果包含在结果中 ,因为它比今天少。 但我不想包括当前月份。 任何想法。 鲍勃

Hi, I have some sql in a sub that finds dates in a table but only if the date is less than today WHERE [MonthYear] < Now() I want it to do that but to not include the current month. For instance, a list of dates in dd/mm/yy format 1/01/05 01/02/05 etc etc 01/11/05 01/12/05 01/01/06 01/02/06 If I run this today (11/01/06) 01/01/06 is included in the result because it is less than today. But I dont want the current month included. Any ideas. Bob

推荐答案

" Bob Wickham" <无线********* @ yahoo.au>在留言中写道 news:43 ****** @ dnews.tpgi.au ... "Bob Wickham" <wi*********@yahoo.au> wrote in message news:43******@dnews.tpgi.au... 我在子表中有一些sql,它在表中找到日期,但仅当日期小于今天时 WHERE [MonthYear]<现在() 我希望它能做到这一点,但不包括当前月份。 例如,日期列表以dd / mm / yy格式 1/01/05 01/02/05 等等 01/11/05 01/12/05 01/01 / 06 01/02/06 如果我今天运行(11/01/06)01/01/06包含在结果中,因为它小于今天。但我不想包括当前的月份。 任何想法。 Bob Hi, I have some sql in a sub that finds dates in a table but only if the date is less than today WHERE [MonthYear] < Now() I want it to do that but to not include the current month. For instance, a list of dates in dd/mm/yy format 1/01/05 01/02/05 etc etc 01/11/05 01/12/05 01/01/06 01/02/06 If I run this today (11/01/06) 01/01/06 is included in the result because it is less than today. But I dont want the current month included. Any ideas. Bob

所以你想要包括当前月份的第一个日期? 您可以使用DateSerial函数: .... WHERE MyDate< DateSerial(年(日期),月(日期),1) 我假设你的字段[MonthYear]是一个实际的DateTime字段

So you want to include dates less than the first of the current month? You can use the DateSerial function: ....WHERE MyDate<DateSerial(Year(Date),Month(Date),1) I''m assuming that your field [MonthYear] is an actual DateTime field

" Bob Wickham" <无线********* @ yahoo.au> schreef在bericht新闻:43 ****** @ dnews.tpgi.au ... "Bob Wickham" <wi*********@yahoo.au> schreef in bericht news:43******@dnews.tpgi.au... 我在子中找到了一些sql表中的日期,但仅在日期小于今天的情况下 WHERE [MonthYear]<现在() 我希望它能做到这一点,但不包括当前月份。 例如,日期列表以dd / mm / yy格式 1/01/05 01/02/05 等等 01/11/05 01/12/05 01/01 / 06 01/02/06 如果我今天运行(11/01/06)01/01/06包含在结果中因为它小于今天。但我不想包括当前的月份。 任何想法。 Bob Hi, I have some sql in a sub that finds dates in a table but only if the date is less than today WHERE [MonthYear] < Now() I want it to do that but to not include the current month. For instance, a list of dates in dd/mm/yy format 1/01/05 01/02/05 etc etc 01/11/05 01/12/05 01/01/06 01/02/06 If I run this today (11/01/06) 01/01/06 is included in the result because it is less than today. But I dont want the current month included. Any ideas. Bob

所以你想选择少于当月第一天的所有日期? WHERE DateField< DateSerial(年(现在),月(现在),1) Arno R

So you want to select all dates less than the first day of the current month? WHERE DateField < DateSerial(Year(Now), Month(Now), 1) Arno R

Arno R < AR *********** @ tiscali.nl>在消息中写道 news:43 *********************** @ text.nova.planet.nl ... " Bob Wickham" <无线********* @ yahoo.au> schreef in bericht news:43 ****** @ dnews.tpgi.au ... "Arno R" <ar***********@tiscali.nl> wrote in message news:43***********************@text.nova.planet.nl ... "Bob Wickham" <wi*********@yahoo.au> schreef in bericht news:43******@dnews.tpgi.au... 我在子表中有一些sql,它在表中找到日期,但仅当日期小于今天 WHERE [MonthYear]<现在() 我希望它能做到这一点,但不包括当前月份。 例如,日期列表以dd / mm / yy格式 1/01/05 01/02/05 等等 01/11/05 01/12/05 01/01 / 06 01/02/06 如果我今天运行(11/01/06)01/01/06包含在结果中因为它小于今天。但我不想包括当前的月份。 任何想法。 Bob Hi, I have some sql in a sub that finds dates in a table but only if the date is less than today WHERE [MonthYear] < Now() I want it to do that but to not include the current month. For instance, a list of dates in dd/mm/yy format 1/01/05 01/02/05 etc etc 01/11/05 01/12/05 01/01/06 01/02/06 If I run this today (11/01/06) 01/01/06 is included in the result because it is less than today. But I dont want the current month included. Any ideas. Bob

所以你想选择所有日期少于当前 月的第一天? WHERE DateField< DateSerial(年份(现在),月份(现在),1) Arno R 嘿!你在复制我的答案吗?

So you want to select all dates less than the first day of the current month? WHERE DateField < DateSerial(Year(Now), Month(Now), 1) Arno R Hey! Are you copying my answers?

更多推荐

现在()

本文发布于:2023-11-22 14:49:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1617873.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!