查询列名称/运行周总计 [英] Querying Column Names/ Running Week totals

查看:61
本文介绍了查询列名称/运行周总计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我不知道这是否可行。我知道SQL好了,自从我使用VB以来已经有一段时间了。


但我想做的是查询列名中的日期。


例如我正在跟踪不同类型的问题(示例A,B,C)
4月26日
我从查询开始4开始/ 21? 4/25获取最近5天的数据,这很简单;我只是使用设计视图并选择列标题。


Issue 4/21 4/22 4/23 4/24 4/25 4/26 4/27 4/28 4/29

A 1 0 3 0 4 0 1 2 0

B 2 8 6 6 2 1 0 8 1

C 0 2 4 4 4 6 2 3 0



但我需要做的是创建一个AWAYS(每天)获取DATA的最后5天的查询,而不必每天手动更新查询。


任何帮助将不胜感激!

BTW

在现实中,我需要过去13天,13周和13个月的最后三次查询数据eveyday /周/月和我正在处理一个数据库,该数据库的列数可以追溯到几年前,平均有6000多个记录。

Ok I don?t know if this is possible. I Know SQL Ok and it?s been a while since I worked with VB.

But what I?m trying to do is query by the dates in the column names.

For instance I''m tracking different kinds of issues (Example A, B, C)
on 4/26 I start with a query starting 4/21 ? 4/25 to get the last 5 days of data, that is simple; I just use the design view and select the columns heading.

Issue 4/21 4/22 4/23 4/24 4/25 4/26 4/27 4/28 4/29
A 1 0 3 0 4 0 1 2 0
B 2 8 6 6 2 1 0 8 1
C 0 2 4 4 4 6 2 3 0


But what I need to do is create a query that AWAYS (everyday) get the last 5 days of DATA without manually updating the query every day.

Any help will be appreciated!!

BTW
In Reality I need the last three queries for the last 13 days, 13 weeks and 13 months data eveyday/week/month and I?m dealing with a DB that has columns going back years and on average 6000 + records.

推荐答案

所以...你在说一个动态的交叉表查询?


您可以使用两个查询,一个用于返回过去5天的记录,也返回日期。第二个是交叉表。虽然注意到这对于报告来说不是很实用,因为字段名称会不断变化。
So... you''re talking a dynamic crosstab query?

You can use two queries, one to return records on the past 5 days, also returning the date. And the second would be the crosstab. Although note that this isn''t very practical for a report because the field names would be changing constantly.


我认为这不会起作用。查询结果是链接到电子表格,所以它会搞砸了。最后我会有太多的


有没有办法只选择X量的coulmns?从给定的日期开始?或Cloumns 5,4,3,2,1。我试过很多不同的方法但没有运气。
I don''t think that would work. THe query results are link to a spreadsheets, so it would get all messed up with that. and in the end I will have too many of them

Is there a way to just pick X amounts of coulmns? From a given date? Or Cloumns 5,4,3,2,1. Iv''e tried many differant ways with no luck.


我不太清楚我理解,样本数据不是交叉表查询的结果吗?
I''m not quite sure I understand, is that sample data not the result of a crosstab query?


这篇关于查询列名称/运行周总计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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