按日期报告 [英] report by date

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

问题描述



我的项目在MS Access 2002中。

因为我有一个表单,我用它来生成报告日期。

在那个表单中我有两个三个字段StartDate,EndDate,ItemNo都是 Text 类型。

现在当我选择同一年的StartDate和EndDate然后它正常工作。

但是如果我选择StartDate从上一年和今天的日期作为EndDate那么它将只显示当年的结果和仅StartDate的结果。

手段如果我输入StartDate = 1/1/2007

和EndDate = 02/19/2008

那么它将显示当年的所有结果(1/1 / 2008- 02/19/2008)和结果,匹配日期仅为2007年1月1日

但在2007年1月1日至2008年1月1日期间未显示结果。

我正在使用此查询

Hi,
My project is in MS Access 2002.
In that I have one form which I am using to generate report by date.
In that form I have two three fields StartDate,EndDate,ItemNo all are of type Text.
Now when I select StartDate and EndDate both of same Year then its working properly.
But if I select StartDate from Previous Year and Today''s Date as EndDate then it will simply show results of current year and only of StartDate.
Means if i enter StartDate=1/1/2007
and EndDate=02/19/2008
then it will show all results of current year(1/1/2008-02/19/2008) and results ,match date only 1/1/2007
but its not showing results between 1/1/2007 to 1/1/2008.

I am using this query

展开 | 选择 | Wrap | 行号

推荐答案

您是否尝试将每个日期字段中的数据类型更改为日期数据类型?


问候,

Scott
Have you tried changing the data types in each date field to the Date data type?

Regards,
Scott



您是否尝试将每个日期字段中的数据类型更改为日期数据类型?


问候,

Scott
Have you tried changing the data types in each date field to the Date data type?

Regards,
Scott



不,我不知道怎么做?

是这样的

PARAMETERS [Forms]![Form1]![StartDate] DateTime,[Forms]![Form1]![EndDate] DateTime;

SELECT *

FROM PRODUCTION

WHERE(((PRODUCTION.ODate)不是空的,(PRODUCTION.ODate)在[Forms]![Form1]之间! [StartDate]而且[表格]![Form1]![EndDate]));


或其他什么?

每当我运行此查询时它会告诉我你可以上一个操作。


No I don''t know how to do that?
Is it like this
PARAMETERS [Forms]![Form1]![StartDate] DateTime, [Forms]![Form1]![EndDate] DateTime;
SELECT *
FROM PRODUCTION
WHERE (((PRODUCTION.ODate) Is Not Null And (PRODUCTION.ODate) Between [Forms]![Form1]![StartDate] And [Forms]![Form1]![EndDate]));

Or something else?
whenever i run this query it will show me that you cancled previous operation.


在设计视图中打开相关的表。单击包含日期条目的字段,您将在第二列中看到数据类型。更改为日期/时间。


这将强制进行有效的日期/时间比较而不是现在的比较,这是一个字符串比较。


问候,

Scott
Open the table concerned in Design view. Click on the field that contains your date entries and you will see in the second column the data type. Change to Date/Time.

This will force valid Date/Time comparisons rather than what you have now, which is a String comparison.

Regards,
Scott


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

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