查询中的日期 [英] Date in Query

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

问题描述

我有一个包含大量不同销售数据的查询,其中一个

列是不同的日期。日期从1jan2003到31jan2003。在

这个查询我只想要1jan2003的salesdata。如何从

查询中删除日期

,2jan2003到31jan2003而不从表中删除它们? (因为我想在以后的其他

查询中使用2jan2003等数据)


-kenneth

I have a Query that consist of a lot of different sales data, and one of the
colums are different date. The date goes from 1jan2003 til 31jan2003. in
this Query I only want the salesdata for 1jan2003. How do I remove the dates
, 2jan2003 til 31jan2003 without removing them from the table, from the
Query? (Because I want to use the data for 2jan2003 etc later in other
queries)

-kenneth

推荐答案

示例:


选择*来自tblMyTable其中DateField =#1/1/2003#


这个将从日期字段为1月的表格中选择所有记录

2003.查询需要以美国格式格式化的日期。 #符号是日期

分隔符,因此Access知道这是一个日期而不是分区。如果您要进行多个查询,例如这个查询,您可能需要在参数查询的帮助文件中查看

。这将导致查询提示您运行它的日期




-

Wayne Morgan

Microsoft Access MVP

" Kenneth" < SN ******* @ hotmail.com>在消息中写道

news:c6 ********** @ dolly.uninett.no ...
Example:

Select * From tblMyTable Where DateField = #1/1/2003#

This will select all records from the table where the date field is 1 Jan
2003. The query wants the date formatted in US format. The # signs are date
delimiters so that Access knows that this is a date and not division. If you
are going to make multiple queries such as this one, you may want to look in
the help file for Parameter Queries. This will cause the query to prompt you
for the date when you run it.

--
Wayne Morgan
Microsoft Access MVP
"Kenneth" <sn*******@hotmail.com> wrote in message
news:c6**********@dolly.uninett.no...
我有一个包含很多的查询不同的销售数据和
之一的colums是不同的日期。日期从1jan2003到31jan2003。在这个查询中我只想要1jan2003的salesdata。如何从
查询中删除
日期,2jan2003直到31jan2003而不从表中删除它们? (因为我想在以后的其他
查询中使用2jan2003等数据)

-kenneth
I have a Query that consist of a lot of different sales data, and one of the colums are different date. The date goes from 1jan2003 til 31jan2003. in
this Query I only want the salesdata for 1jan2003. How do I remove the dates , 2jan2003 til 31jan2003 without removing them from the table, from the
Query? (Because I want to use the data for 2jan2003 etc later in other
queries)

-kenneth



我试过这个公式:

选择*来自tblMyTable其中DateField =#1/1/2003#


并将MyTable更改为Date,是我日期栏目的名称,但

它不起作用。


我做错了吗?

-kenneth

-

" Wayne Morgan" <共*************************** @ hotmail.com>在消息中写道

news:VJ ************** @ newssvr16.news.prodigy.com ..。
I have tried the formula:
Select * From tblMyTable Where DateField = #1/1/2003#

and changed MyTable to Date, which is the name of my column with date, but
it doesn''t work.

Have I done anything wrong?

-kenneth

--
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:VJ**************@newssvr16.news.prodigy.com.. .
示例:

选择*来自tblMyTable其中DateField =#1/1/2003#

这将从表中选择日期字段为1 Jan
2003的所有记录。查询需要以美国格式格式化的日期。 #符号是
日期分隔符,因此Access知道这是一个日期而不是分区。如果
您要进行多个查询,例如此查询,您可能需要在参数查询的帮助文件中查看
。这将导致查询提示
你运行它的日期。

-
Wayne Morgan
Microsoft Access MVP

肯尼思 < SN ******* @ hotmail.com>在消息中写道
新闻:c6 ********** @ dolly.uninett.no ...
Example:

Select * From tblMyTable Where DateField = #1/1/2003#

This will select all records from the table where the date field is 1 Jan
2003. The query wants the date formatted in US format. The # signs are date delimiters so that Access knows that this is a date and not division. If you are going to make multiple queries such as this one, you may want to look in the help file for Parameter Queries. This will cause the query to prompt you for the date when you run it.

--
Wayne Morgan
Microsoft Access MVP
"Kenneth" <sn*******@hotmail.com> wrote in message
news:c6**********@dolly.uninett.no...
我有一个包含大量不同销售数据的查询,
I have a Query that consist of a lot of different sales data, and one of


colums是不同的日期。日期从1jan2003到31jan2003。在这个查询中我只想要1jan2003的salesdata。如何从
查询中删除
colums are different date. The date goes from 1jan2003 til 31jan2003. in
this Query I only want the salesdata for 1jan2003. How do I remove the


日期

,2jan2003到31jan2003而不从表中删除它们? (因为我想在以后的其他
查询中使用2jan2003等数据)

-kenneth
, 2jan2003 til 31jan2003 without removing them from the table, from the
Query? (Because I want to use the data for 2jan2003 etc later in other
queries)

-kenneth




Kenneth写道:
Kenneth wrote:
我试过这个公式:
选择*来自tblMyTable其中DateField =#1/1/2003#

并将MyTable更改为Date,这是我的日期列的名称,但是
它不起作用。

我做错了什么?


是的。你的桌名是什么?转到数据库窗口并选择

Tables。找出你正在设计查询的表格名称

周围。 Tmen将tblMyTable替换为该名称。现在以

设计模式打开表格。确定要过滤的日期字段的名称。关闭

表。用字段的名称替换DateField。


你是否有大脑冻结:-)


-kenneth

-
韦恩摩根 <共*************************** @ hotmail.com>在消息中写道
新闻:VJ ************** @ newssvr16.news.prodigy.com ..
I have tried the formula:
Select * From tblMyTable Where DateField = #1/1/2003#

and changed MyTable to Date, which is the name of my column with date, but
it doesn''t work.

Have I done anything wrong?
Yes. What is your table name? Go to the database window and select
Tables. Find out what the table name is your are designing your query
around. Tmen substitute tblMyTable to that name. Now open the table in
design mode. Determine the name of your date field to filter on. Close
the table. Substitute DateField with the name of the field.

Did you have a brain freeze :-)


-kenneth

--
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:VJ**************@newssvr16.news.prodigy.com.. .
示例:

选择*来自tblMyTable其中DateField =#1/1/2003#

这将从表中选择日期字段为1 Jan
2003的所有记录。查询需要以美国格式格式化的日期。 #符号
Example:

Select * From tblMyTable Where DateField = #1/1/2003#

This will select all records from the table where the date field is 1 Jan
2003. The query wants the date formatted in US format. The # signs are



date



date

分隔符,以便Access知道这是一个日期而不是分区。如果
delimiters so that Access knows that this is a date and not division. If





you

将要进行多个查询,例如此查询,您可能需要查看
are going to make multiple queries such as this one, you may want to look






in

参数查询的帮助文件。这将导致查询提示
the help file for Parameter Queries. This will cause the query to prompt





you

作为运行日期。






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

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