使用不同日期范围的查询 [英] Queries using different date ranges

查看:60
本文介绍了使用不同日期范围的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个查询,用于在两个指定日期之间收集数据。

在查询列中显示为:


介于#24/09之间/ 2004#和#01/10/2004#


是否可以输入几个不同的日期范围,即24/09/2004

和01之间/ 10/2004以及05/10/2004和07/10/2004?


如果我输入在...之间不同行的标准它没有返回数据。


一些指针会很有用 - 谢谢。


我在Win上使用Access 2000已安装SP2的XP Home。


Steve。

I have a query set up to gather together data between two specified dates.
Shown in the query column as:

Between #24/09/2004# And #01/10/2004#

Is it possible to enter several different date ranges, ie between 24/09/2004
and 01/10/2004 together with 05/10/2004 and 07/10/2004 ?

If I enter the "Between" criteria on different lines it returns no data.

Some pointers would be useful - thanks.

I''m using Access 2000 on Win XP Home with SP2 installed.

Steve.

推荐答案

将日期字段两次下拉到查询中网格。把他跟在第一个下面的

标准中:

#24/09/2004#和#01/10/2004#

并将他列入第二个标准下:

#05/10/2004#和#07/10/2004#


注意:两个条件表达式必须在同一行中


当您为同一行中的多个字段设置标准时,Access

将它们视为AND条件。


-

PC数据表

您的资源获取Access,Excel和Word应用程序的帮助
< a href =mailto:re ****** @ pcdatasheet.com> re ****** @ pcdatasheet.com
www.pcdatasheet.com

" Steve Elliott" < ST *** @ olympicradio.freeserve.co.uk>在消息中写道

news:cl ********** @ news6.svr.pol.co.uk ...
Pull down your date field twice into the query grid. Put he following in the
criteria under the first one:
Between #24/09/2004# And #01/10/2004#
and put he following in the criteria under the second one:
Between #05/10/2004# And #07/10/2004#

Note: both criteria expressions must be in the same row

When you have criteria set for more than one field in the same row, Access
treats them as AND conditions.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve Elliott" <st***@olympicradio.freeserve.co.uk> wrote in message
news:cl**********@news6.svr.pol.co.uk...
我有一个查询集在两个指定日期之间收集数据。
在查询栏中显示为:

#24/09/2004#和#01/10/2004#
<是否可以输入几个不同的日期范围,即在2004年9月24日和2004年10月1日之间以及05/10/2004和07/10/2004之间进行


如果我输入之间不同行上的标准它没有返回任何数据。

一些指针会很有用 - 谢谢。

我在安装了SP2的Win XP Home上使用Access 2000。 />
史蒂夫。
I have a query set up to gather together data between two specified dates.
Shown in the query column as:

Between #24/09/2004# And #01/10/2004#

Is it possible to enter several different date ranges, ie between 24/09/2004 and 01/10/2004 together with 05/10/2004 and 07/10/2004 ?

If I enter the "Between" criteria on different lines it returns no data.

Some pointers would be useful - thanks.

I''m using Access 2000 on Win XP Home with SP2 installed.

Steve.



谢谢你的建议,虽然我仍然无法上班。我的

两个日期列显示如下:


字段:日期

表:交易

总计:哪里

交叉表:

排序:

标准:#24/09/2004#和#01/10/2004#

或:


在查询网格的下一列中相同,其他在...之间日期。


Access 2000不返回任何数据。我在查询网格中有9列。


我不明白为什么Access不会只返回这些

两套的总额日期。


谢谢,

史蒂夫。

" PC数据表" <无**** @ nospam.spam>在消息中写道

新闻:Oj *************** @ newsread2.news.atl.earthlin k.net ...
Hi, thanks for your suggestion, although I still can''t get it to work. My
two DATE columns are shown thus:

Field: Date
Table: Transactions
Total: Where
Crosstab:
Sort:
Criteria: Between #24/09/2004# And #01/10/2004#
Or:

Same in the next column of the query grid, with the other "between" dates.

Access 2000 returns no data. I have 9 columns within the query grid.

I can''t understand why Access wouldn''t just return a grand total for these
two sets of dates.

Thanks,

Steve.
"PC Datasheet" <no****@nospam.spam> wrote in message
news:Oj***************@newsread2.news.atl.earthlin k.net...
将日期字段两次下拉到查询网格中。让他遵循第一个标准下的
标准:
在#24/09/2004#和#01/10/2004#
之间并按照标准执行在第二个下:
#05/10/2004#和#07/10/2004#

注意:两个标准表达式必须在同一行中

当您为同一行中的多个字段设置了条件时,Access
会将它们视为AND条件。

-
PC数据表
您的资源有关Access,Excel和Word应用程序的帮助
re******@pcdatasheet.com
www.pcdatasheet.com

" Steve Elliott" < ST *** @ olympicradio.freeserve.co.uk>在消息中写道
新闻:cl ********** @ news6.svr.pol.co.uk ...
Pull down your date field twice into the query grid. Put he following in
the
criteria under the first one:
Between #24/09/2004# And #01/10/2004#
and put he following in the criteria under the second one:
Between #05/10/2004# And #07/10/2004#

Note: both criteria expressions must be in the same row

When you have criteria set for more than one field in the same row, Access
treats them as AND conditions.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve Elliott" <st***@olympicradio.freeserve.co.uk> wrote in message
news:cl**********@news6.svr.pol.co.uk...
我有一个查询设置聚集在一起两个指定的日期之间的数据。
在查询栏中显示为:

#24/09/2004#和#01/10/2004#
<是否可以输入几个不同的日期范围,即
I have a query set up to gather together data between two specified
dates.
Shown in the query column as:

Between #24/09/2004# And #01/10/2004#

Is it possible to enter several different date ranges, ie between


24/09/2004


24/09/2004

和01/10/2004以及05/10/2004和07/10/2004?

如果我输入在...之间不同行上的标准它没有返回任何数据。

一些指针会很有用 - 谢谢。

我在安装了SP2的Win XP Home上使用Access 2000。 />
史蒂夫。
and 01/10/2004 together with 05/10/2004 and 07/10/2004 ?

If I enter the "Between" criteria on different lines it returns no data.

Some pointers would be useful - thanks.

I''m using Access 2000 on Win XP Home with SP2 installed.

Steve.




史蒂夫,


(从一个史蒂夫到另一个!)


将您的查询更改为选择查询。请确保在交叉表中包含您想要的所有字段以及日期字段两次。考虑此查询

作为数据。查询。一旦你有了这个查询返回你想要的记录,就可以根据第一个查询创建一个新的交叉表查询。仅包含您要报告的

字段。标准将在第一个查询中,因此您需要在交叉表中不需要任何标准。


然而,在执行上述操作之前,请更改您命名的字段的名称

" Date"。日期是Access中的保留字,您不应该将其用作

名称的任何内容。


Steve

PC数据表

" Steve Elliott" < ST *** @ olympicradio.freeserve.co.uk>在消息中写道

news:cl ********** @ newsg2.svr.pol.co.uk ...
Steve,

(from one Steve to another!)

Change your query to a Select query. Be sure to include all the fields you
want in your crosstab as well as the date field twice. Consider this query
as the "data" query. Once you have this query returning the records you
want, create a new crosstab query based on the first query. Only include the
fields you want to report. The criteria will be in the first query so you
don''t need any criteria in the crosstab.

Before you do the above however, change the name of the field you named
"Date". Date is a reserved word in Access and you should not use it for the
name of anything.

Steve
PC Datasheet
"Steve Elliott" <st***@olympicradio.freeserve.co.uk> wrote in message
news:cl**********@newsg2.svr.pol.co.uk...
谢谢你的建议,虽然我仍然无法让它工作。我的
两个DATE列如此显示:

字段:日期
表:交易
总计:哪里
交叉表:
排序:<标准:在#24/09/2004#和#01/10/2004之间#
或者:

在查询网格的下一列中,与另一列相同之间"日期。

Access 2000不返回任何数据。我在查询网格中有9列。

我无法理解为什么Access不会仅为这两个日期返回总计。
<谢谢,

史蒂夫。

" PC数据表" <无**** @ nospam.spam>在消息中写道
新闻:Oj *************** @ newsread2.news.atl.earthlin k.net ...
Hi, thanks for your suggestion, although I still can''t get it to work. My
two DATE columns are shown thus:

Field: Date
Table: Transactions
Total: Where
Crosstab:
Sort:
Criteria: Between #24/09/2004# And #01/10/2004#
Or:

Same in the next column of the query grid, with the other "between" dates.

Access 2000 returns no data. I have 9 columns within the query grid.

I can''t understand why Access wouldn''t just return a grand total for these
two sets of dates.

Thanks,

Steve.
"PC Datasheet" <no****@nospam.spam> wrote in message
news:Oj***************@newsread2.news.atl.earthlin k.net...
拉下你的日期字段两次进入查询网格。让他遵循第一个标准下的
标准:
在#24/09/2004#和#01/10/2004#
之间并按照标准执行在第二个下:
#05/10/2004#和#07/10/2004#

注意:两个标准表达式必须在同一行中

当您为同一行中的多个字段设置标准时,
Access会将它们视为AND条件。

-
PC数据表
您的资源有关Access,Excel和Word应用程序的帮助
re******@pcdatasheet.com
www.pcdatasheet.com

" Steve Elliott" < ST *** @ olympicradio.freeserve.co.uk>在消息中写道
新闻:cl ********** @ news6.svr.pol.co.uk ...
Pull down your date field twice into the query grid. Put he following in
the
criteria under the first one:
Between #24/09/2004# And #01/10/2004#
and put he following in the criteria under the second one:
Between #05/10/2004# And #07/10/2004#

Note: both criteria expressions must be in the same row

When you have criteria set for more than one field in the same row, Access treats them as AND conditions.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve Elliott" <st***@olympicradio.freeserve.co.uk> wrote in message
news:cl**********@news6.svr.pol.co.uk...
我有一个查询设置聚集在一起两个指定的日期之间的数据。
在查询栏中显示为:

#24/09/2004#和#01/10/2004#
<是否可以输入几个不同的日期范围,即
I have a query set up to gather together data between two specified
dates.
Shown in the query column as:

Between #24/09/2004# And #01/10/2004#

Is it possible to enter several different date ranges, ie between


24/09/2004


24/09/2004

和01/10/2004以及05/10/2004和07/10/2004?

如果我输入在...之间不同行的标准它不会返回
数据。
有些指针会很有用 - 谢谢。

我在安装了SP2的Win XP Home上使用Access 2000。 />
史蒂夫。
and 01/10/2004 together with 05/10/2004 and 07/10/2004 ?

If I enter the "Between" criteria on different lines it returns no data.
Some pointers would be useful - thanks.

I''m using Access 2000 on Win XP Home with SP2 installed.

Steve.





这篇关于使用不同日期范围的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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