选择仅返回10列 [英] Select Only 10 Columns Going Back

查看:74
本文介绍了选择仅返回10列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在MS Access中仅从最后12列创建一个sql语句,该表具有日期(该月的最后几天)作为列的名称。实际上,每列都是每月发送到我办公室的表格的一部分。我只使用一个特定的列并丢弃其余的列。然后表格中的列如下所示:

展开 | 选择 | Wrap | 行号

解决方案

您是否在创建(期待创建) )代码中的SQL语句?

这可以使用代码完成,但可能很繁琐。更确切地说明您正在处理的内容可能至关重要。



您是否正在创建(期望创建)代码中的SQL语句?

这可以使用代码完成,但可能很繁琐。更确切地说明您正在处理的内容可能至关重要。



是的,SQL语句将在代码中创建。基本上,这就是根据他们本月发生的错误来衡量就业绩效,并将当前数字与之前的数据进行比较。例如,对于员工A,2008年3月的错误数为324,2008年2月的错误数为420,2008年1月的错误数为200,等等......一直追溯到2007年3月,看看如何错误随着时间的推移而增加或减少。该应用程序的用户希望能够通过从任何给定的月份中选择并以每月增量回顾一年来确定性能并且衡量性能。我想过为每个月创建数组,但出现了问题......


数据中有多少列?

是数字已修复?

它们相对于当月(月(日期())的定位方式?

代码运行在哪里?

现在运行完成后你想要的SQL是什么?


通过这些答案,我们可以看看如何根据所需数据生成SQL。

I need to create a sql statement in MS Access from only the last 12 columns a table that has has dates (the last days of the month) as the names of the columns. In actuality, each column is part of table that is sent to my office monthly. I only use one particular column and discard the rest. The columns in the table then looks like this:

Expand|Select|Wrap|Line Numbers

解决方案

Are you creating (expecting to create) the SQL statement in code?
This can be done using code but might be fiddly. A clearer indication of exactly what you''re dealing with is likely to be crucial.


Are you creating (expecting to create) the SQL statement in code?
This can be done using code but might be fiddly. A clearer indication of exactly what you''re dealing with is likely to be crucial.

Yes the SQL statement is to be created in code. Basically what this is about is measuring the performance of employess in terms of how many errors they made this month and compare the current figure with the ones made before. For example, for employee A the number of errors for the Month of March 2008 is 324, for february 2008 is 420, for January 2008 is 200, etc....going all the back to the month of March 2007 and see how the errors have increased or decreased over time. The users of this application want to be able to do this by picking from any given month and look back up to a year in monthly increments
and measure performance. I thought of creating arrays for each month but something goes wrong......


How many columns are there then in the data?
Is the number fixed?
How are they positioned relative to the current month (Month(Date()))?
Where is the code to run from?
What is the SQL that you want as a result of a run done now?

With these answers we can look at how to produce the SQL relative to the data required.


这篇关于选择仅返回10列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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