日期标准之间的问题 [英] Between Date criteria problem

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

问题描述

我在日期标准中有以下2个查询


在DateAdd之间(&m;, - 6,([Forms]![Maff count form]![1st日期]))和

([表格]![Maff计数表]![第1次约会])


在DateAdd之间(&m;), - 24,([表格]![Maff计数表]![第1日期]))和

DateAdd(m, - 6,([表格]![Maff计数表]![第1个日期]))


问题是它们都是在输入日期前6个月的同一天查看的。例如

日期输入= 28/02/2004然后两个查询从28/08/2003获取数据


如何更改第一行以便它会(在给出的例子中)从

29/08/2003到28/02/2004


TIA

David B

解决方案

如果你想使用DateAdd函数试试:

DateAdd(" d" ;, - 183,([表格]![Maff计数表]![第1次约会]))因为

两个日期之间的差异为183天,无论如何都是6个月。如果您只是想要输入日期,请​​尝试#29/08/2003#和#28/02/2004#


斯图尔特

" David B" <沓*** @ marleycotenospam.fsnet.co.uk>在留言中写道

news:c1 ********** @ newsg1.svr.pol.co.uk ...

我有2个查询日期标准中的以下内容

在DateAdd(" m", - 6,([Forms]![Maff count form]![1st date]))和
之间([表格] ]![Maff计数表]![第1次约会])

在DateAdd之间(m, - 24,([表格]![Maff计数表]![第1次约会]))和
DateAdd(m, - 6,([表格]![Maff计数表]![第1次约会]))

问题是他们都在同一天看了6个月在输入
之前。例如,输入日期= 28/02/2004然后两个查询从28/08/2003获取数据

如何更改第一行,以便它(在给出的示例中)为
从2003年8月29日至28/02/2004

TIA
David B



感谢回复

183天的问题是另外6个月减去1天的时间可能不是

这个天数

不想要直接在查询中输入日期。我在表格上输入一个日期,

点击一个按钮,会发生很多数字运算(这是其中的一部分)

DB


Stewart Allen< sa **** @ ThisPartNotVailid.wave.co.nz>在消息中写道

news:c1 ********** @ news.wave.co.nz ...

如果你想使用DateAdd功能尝试:
DateAdd(" d", - 183,([Forms]![Maff count form]![1st date]))因为两个日期之间有183天的差异,这是无论如何6个月。如果您只是想要输入日期,请​​尝试#29/08/2003#和#28/02/2004#

斯图尔特

David B" ; <沓*** @ marleycotenospam.fsnet.co.uk>在消息中写道
新闻:c1 ********** @ newsg1.svr.pol.co.uk ...

我有2个查询,其中包含以下内容:日期标准

在DateAdd(&m;, - 6,([Forms]![Maff count form]![1st date]))和
之间([Forms]![Maff]计数表格!![第1日期])

在DateAdd(&m;, - 24,([Forms]![Maff count form]![1st date]))和
之间DateAdd(" m", - 6,([Forms]![Maff count form]![1st date]))

问题是它们都是在日期前6个月的同一天查看


已输入。例如,

输入日期= 28/02/2004然后两个查询从28/08/2003获取数据

如何改变第一行以便它(在给出的例子)

29/08/2003至28/02/2004

大卫B


blockquote>




嗨David,

最好的办法是使用2表单上的日期字段,并使用

以下标准:

[Forms]![YourFormName]![DateFrom]和

之间[表格]![YourFormName]![DateTo]


这样你可以在表格中输入你想要的任何日期,并将其用作

过滤器,然后不需要硬编码日期到查询中。


斯图尔特

" David B" <沓*** @ marleycotenospam.fsnet.co.uk>在消息中写道

新闻:c1 ********** @ newsg4.svr.pol.co.uk ...

感谢您的回复<问题与183天是另一个6个月减去1天的时间可能不是
那个天数
不想直接输入查询日期。我在
表单上输入一个日期,点击一个按钮,发生了大量的数字运算(其中这是
部分)DB

Stewart Allen< sa **** @ ThisPartNotVailid.wave.co.nz>在消息中写道
新闻:c1 ********** @ news.wave.co.nz ...

如果你想使用DateAdd函数试试:
DateAdd(" d", - 183,([Forms]![Maff count form]![1st date]))因为
是2个日期之间的183天差异,无论如何是6个月。如果你想要输入日期,只需要输入日期#29/08/2003#和#28/02/2004#

斯图尔特

" David B" ; <沓*** @ marleycotenospam.fsnet.co.uk>在消息中写道
新闻:c1 ********** @ newsg1.svr.pol.co.uk ...

我有2个查询,其中包含以下内容:日期标准

在DateAdd(&m;, - 6,([Forms]![Maff count form]![1st date]))和
之间([Forms]![Maff]计数表格!![第1日期])

在DateAdd(&m;, - 24,([Forms]![Maff count form]![1st date]))和
之间DateAdd(" m", - 6,([Forms]![Maff count form]![1st date]))

问题是它们都是在日期前6个月的同一天查看


已输入。例如,

输入日期= 28/02/2004然后两个查询都从
28/08/2003中获取数据
如何更改第一行以便它(在示例


给出)来自

29/08/2003至28/02/2004

TIA
David B




I have 2 querys with the following in the date criteria

Between DateAdd("m",-6,([Forms]![Maff count form]![1st date])) And
([Forms]![Maff count form]![1st date])

Between DateAdd("m",-24,([Forms]![Maff count form]![1st date])) And
DateAdd("m",-6,([Forms]![Maff count form]![1st date]))

Problem is they both look at the same day 6 months before the date entered. eg
date entered = 28/02/2004 then both querys pick up data from 28/08/2003

How do I alter the first line so that it would ( in the example given ) go from
29/08/2003 to 28/02/2004

TIA
David B

解决方案

If you want to use the DateAdd function try:
DateAdd("d",-183,([Forms]![Maff count form]![1st date])) because there is
183 day difference between the 2 dates which is 6 months anyway. If you just
want to enter the date try Between #29/08/2003# And #28/02/2004#

Stewart
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c1**********@newsg1.svr.pol.co.uk...

I have 2 querys with the following in the date criteria

Between DateAdd("m",-6,([Forms]![Maff count form]![1st date])) And
([Forms]![Maff count form]![1st date])

Between DateAdd("m",-24,([Forms]![Maff count form]![1st date])) And
DateAdd("m",-6,([Forms]![Maff count form]![1st date]))

Problem is they both look at the same day 6 months before the date entered. eg date entered = 28/02/2004 then both querys pick up data from 28/08/2003

How do I alter the first line so that it would ( in the example given ) go from 29/08/2003 to 28/02/2004

TIA
David B



Thanks for the reply
Problem with the 183 days is another 6 month minus 1 day period might not be
that number of days
Don`t want to enter the date direct into the query. I enter one date on a form,
click a button and lots of number crunching happens (of which this is part)
DB

Stewart Allen <sa****@ThisPartNotVailid.wave.co.nz> wrote in message
news:c1**********@news.wave.co.nz...

If you want to use the DateAdd function try:
DateAdd("d",-183,([Forms]![Maff count form]![1st date])) because there is
183 day difference between the 2 dates which is 6 months anyway. If you just
want to enter the date try Between #29/08/2003# And #28/02/2004#

Stewart
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c1**********@newsg1.svr.pol.co.uk...

I have 2 querys with the following in the date criteria

Between DateAdd("m",-6,([Forms]![Maff count form]![1st date])) And
([Forms]![Maff count form]![1st date])

Between DateAdd("m",-24,([Forms]![Maff count form]![1st date])) And
DateAdd("m",-6,([Forms]![Maff count form]![1st date]))

Problem is they both look at the same day 6 months before the date


entered. eg

date entered = 28/02/2004 then both querys pick up data from 28/08/2003

How do I alter the first line so that it would ( in the example given ) go


from

29/08/2003 to 28/02/2004

TIA
David B





Hi David,
The best way to do this is to use 2 date fields on your form and use the
following for your criteria:
Between [Forms]![YourFormName]![DateFrom] And
[Forms]![YourFormName]![DateTo]

This way you can enter any dates you want into the form and use that as the
filter, no hard coding the dates into the query is then needed.

Stewart
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c1**********@newsg4.svr.pol.co.uk...

Thanks for the reply
Problem with the 183 days is another 6 month minus 1 day period might not be that number of days
Don`t want to enter the date direct into the query. I enter one date on a form, click a button and lots of number crunching happens (of which this is part) DB

Stewart Allen <sa****@ThisPartNotVailid.wave.co.nz> wrote in message
news:c1**********@news.wave.co.nz...

If you want to use the DateAdd function try:
DateAdd("d",-183,([Forms]![Maff count form]![1st date])) because there is 183 day difference between the 2 dates which is 6 months anyway. If you just want to enter the date try Between #29/08/2003# And #28/02/2004#

Stewart
"David B" <Da***@marleycotenospam.fsnet.co.uk> wrote in message
news:c1**********@newsg1.svr.pol.co.uk...

I have 2 querys with the following in the date criteria

Between DateAdd("m",-6,([Forms]![Maff count form]![1st date])) And
([Forms]![Maff count form]![1st date])

Between DateAdd("m",-24,([Forms]![Maff count form]![1st date])) And
DateAdd("m",-6,([Forms]![Maff count form]![1st date]))

Problem is they both look at the same day 6 months before the date


entered. eg

date entered = 28/02/2004 then both querys pick up data from 28/08/2003
How do I alter the first line so that it would ( in the example

given ) go from

29/08/2003 to 28/02/2004

TIA
David B




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

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