股市数据库:图表和报告问题。 [英] Stock Market Database: Charts and Reporting problems.

查看:92
本文介绍了股市数据库:图表和报告问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有人,我们的任务是设计一个工作中的数据库,可以保存大约70多家公司的信息。该数据库包含有关其财务,历史股票数据,历史货币数据和其他一些公司的信息。


我不是一个远程数据库专家,但是在一些帮助和使用我过去的一些基本编程知识后,我能够编写一些VBA代码,为许多其他值生成一些计算表。


现在有我现在遇到的两个问题:


首先,它是关于Access中的图表选项;我需要能够使用Historical_Stock_data表中的数据生成每日股票市场价格变化和交易量图表;它具有(StockCode,Dates)的复合键。我能够相当容易地生成两个图表并修改它们但我不完全确定为什么它不会过滤任何其他公司的图表,它只使用第一家公司的数据开始字母''A''。不太清楚这是如何工作的。


其次,我正在生成单一公司报告,其中包含有关每日价格,24个月高/低,市值,信息的信息。他们的让步以及该表中的所有财务信息。现在我在这里做的是设计了一个子报告,它保存了年度财务数据并将其嵌入主报告中。这里对公司的过滤工作正常;当我按下表单上的按钮时,它会提示输入公司名称,然后根据该名称显示报告。这里的问题是,根据财务表中有多少年的信息,报告在主报告中生成了许多嵌入式子报告;例如,当我为2009年和2009年提供数据时2010年它在主报告中生成两个嵌入式子报告,两者都显示相同的数据。


任何帮助将不胜感激。



Hey all, have been tasked to design a database at work, that can hold information about some 70 odd companies. The database holds information about their financials, Historical Stock data, historical currency data and a few other things about each of the companies.

I''m no database expert by a long shot, but with some help and using some of my past knowledge in basic programming I was able to write some VBA code, to generate some calculated tables for a number of other values.

Now there are two issues that I''m currently having:

Firstly, it''s regarding the charts option in Access; I need to be able to generate daily stock market price change and volume charts using the data in the Historical_Stock_data table; which has a composite key of (StockCode,Dates). I was able to generate both charts fairly easily and modify them but I''m not totally sure why it isn''t filtering the chart for any of the other companies, it''s only using the data for the first company starting with the letter ''A''. Not too sure how this will work.

Secondly, I''m generating single company reports, which holds information about there daily price, 24 month Hi/Lo, Market cap, informationg about their concessions plus all the financial information which is in that table as well. Now what I did here was, designed a subreport which holds the yearly financial data and embedded it in the main report. The filtering here for the companies works fine; in that when I press a button on the form, it prompts for the company name, then it brings up a report based on that. The problem here is, depending on how many years worth of information there is in the financial table, the report generates that many embedded subreports in the main report; for example when I put data for 2009 & 2010 it generates two embedded subreports in the main report, both showing the same data.

Any help would be appreciated.

附加图片
Relationships.jpg (21.1 KB,3179 views)
Attached Images
Relationships.jpg (21.1 KB, 3179 views)

推荐答案

图表的SQL是什么?


报告的SQL是什么?


子报告的SQL是什么?


哪些字段将子报告绑定到报告?〜)
What is the SQL for the chart?

What is the SQL for the report?

What is the SQL for the subreport?

And what fields binds the subreport to the report?~)


我正在使用Access 2007,所以对于这部分已经使用向导设计报表和表单。不知道如何访问它的SQL部分。
I''m using Access 2007, so for this part have been using the wizard to design the reports and forms. Not sure how to access the SQL part of it.


图表的SQL是:

TRANSFORM Sum(Historical_Stock_Data.SharePrice)AS SumOfSharePrice

SELECT(格式([日期],短日期))AS Expr1

FROM Historical_Stock_Data

WHERE(((Historical_Stock_Data.Dates )#9 / 15/2008 17:47:42#和#9 / 15/2010 17:47:42#))

GROUP BY(Int([Dates])),(格式) ([日期],短日期))

PIVOT Historical_Stock_Data.StockCode;


现在它需要通过StockCode过滤数据,因此它可以单独生成每个公司的图表
The SQL for the chart is:

TRANSFORM Sum(Historical_Stock_Data.SharePrice) AS SumOfSharePrice
SELECT (Format([Dates],"Short Date")) AS Expr1
FROM Historical_Stock_Data
WHERE (((Historical_Stock_Data.Dates) Between #9/15/2008 17:47:42# And #9/15/2010 17:47:42#))
GROUP BY (Int([Dates])), (Format([Dates],"Short Date"))
PIVOT Historical_Stock_Data.StockCode;


Now it needs to filter the data by StockCode, so it can generate the graphs for each company seperately


这篇关于股市数据库:图表和报告问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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