根据数据表的时间戳创建特定月份的查询 [英] Create a query for a specific month depending on the time-stamp of a data table

查看:117
本文介绍了根据数据表的时间戳创建特定月份的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我是Access 2010中的新人。但是,我知道一些VBA编程。

I am quite a new person in Access 2010. However, I know a bit of a VBA programming.

我想知道如何设置查询或甚至几个查询会将我的整个数据制成块(我希望每个查询都包含每个月的数据)。我知道我可以在表格中为我的数据应用过滤器,但我想查询
以后我可以用它来进行更多的计算和数据处理,以便在更小的部分中制作数据......

I would like to know how can I set a query or even few queries that would brake my entire data into chunks (I want every query to contain a data for each month). I know that I can apply a filter for my data in table, but I want to make a query that later I could use it for more calculations and data processing to brake data in even smaller pieces...

我每15秒就有一个数据表(所以有很多数据)。而且,数据是动态的,因为我是从文本文件中读取的。所以它可以从2016年7月31日23:37:02开始,直到2016年10月10日15:XX:XX等。

I have data in a table for each 15 seconds (so there are a lot of data). Moreover, the data is dynamic, because I read it from text file. So it can start from 31-07-2016 23:37:02 and go until 10-10-2016 15:XX:XX, etc.

我的任务是制动这一切数据进入一段时间(在这种情况下:每月)。

My task is to brake all this data into periods of time (in this case: per month).

任何想法如何构建这样的查询?或者只有VBA代码才能在这种情况下提供帮助?

Any ideas how can I built such a query? or it is only VBA code that can help in this case?

数据的打印屏幕:

 

推荐答案

导入文本数据时,是否将日期/时间值转换为日期/时间字段?

When you import the text data, do you convert the date/time value into a date/time field?

查询仅仅是"视图"。表中的数据。例如,如果您想"看到"一个月的信息,您可以应用"标准",在您的查询中仅返回特定月份内的数据。

Queries are merely "views" of the data in a table. For example, if you want to "see" one month's worth of information, you can apply a "criteria" in your query to return only those data within a specific month.

例如:

字段:TimeStamp

条件:2016年1月1日00:00:00和2016年10月31日23:59:59

Field: TimeStamp
Criteria: Between 01-10-2016 00:00:00 And 31-10-2016 23:59:59

希望它有所帮助......

Hope it helps...


这篇关于根据数据表的时间戳创建特定月份的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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