统计数据报告 [英] statistical data report

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

问题描述

我正在制作数据库软件
前端是vb 6.0
后端是msaccess
一个模块是显示统计数据:
会有一个组合框和一个命令按钮
用户可以从组合框n中选择年份,然后可以单击命令按钮以生成在上述组合框中选择的年份的逐月图形.
我的查询如下:
1.在表格加载时,我需要从数据库中获得不同的年份. (因为我们无法在数据库中提供硬编码的年份值)
如何获得?
2.当用户选择特定的年份时,如何获取与该特定年份相关的数据条目,以及如何将它们分类为12个不同的月份.
例如,如果用户自2008年以来一直使用s/w,则在组合框中的输入应为
2008
2009
2010
2011
(我的第一个查询是如何从数据库中获得不同的年份条目)
当用户选择年份时说2009,然后单击命令按钮时,此处的图形将显示该特定年份的月份
所以现在如何按年n获取数据,然后按月对数据进行排序,如
2009年1月
2009年2月
2009年3月
..
...
Thnks.

I am making a database software
front end is vb 6.0
back end is msaccess
one module is to display statistical data:
there will be a combo box n a command button
where user can select year from a combo box n then can click on command button to generate a graph month wise of the year selected in the above combo box.
my queries are as follows:
1. at form load i need to get distinct year from database. (as we cannot give hard coded years value in database)
how to get it?
2. when user select a particular year then how to get data entries related to that particular year and further how to sort them into 12 different months.
e.g if the user is using s/w since 2008 then it in combo box entry should be
2008
2009
2010
2011
(my query no 1 is how to get this distinct year entries from database)
when user select year say 2009 then when it click on command button it here graph is shown month wise of that particular year
so now how to fetch data year wise n then sort it month wise like
january of 2009
february of 2009
march of 2009
..
...
Thnks.

推荐答案

1.您应该使用查询来检索存储在数据库中的所有记录的年份,例如"SELECT DISTINCT YEAR FROM MyTable"

2.当用户选择年份时,您只需要提示12个月的列表即可(您知道该列表不会随着年份而改变...).
1. You should use a query to retrieve all the years of the records stored inside the database, for instance "SELECT DISTINCT YEAR FROM MyTable''

2. When the user selects a year then you have just to prompt the list of the 12 months (you know such list doesn''t change with years...).


这篇关于统计数据报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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