计算一年中每个月的记录 [英] Counting records from each month of year
问题描述
需要大帮助,我在访问数据库中有TblIDexpiry,在我的表单中我有12个标签,每月1月到12月命名,我想要计算一年中每个月有多少记录显示在每个标签上一个月。
使用的正确查询是什么?
我试过的:
我尝试并声明Date.Today.Month和Date.Today.Year并在查询中使用它,从TblName中选择Count('ColumnName')其中ColumnName =& DTM&,但仅计算该表中的所有数据。不要每个月过滤。
你需要学习更多的SQL - 因为这是你的功课,这就是为什么给你的原因。
这是一个SQL参考,它将为您提供您需要知道的内容 - 但您需要了解它: SQL GROUP BY语句 [ ^ ]
您必须了解它 - 并不是很困难并将其转换为VB.NET。结果
Need big help, I have TblIDexpiry in access db, and in my form I have 12 Labels, named each month January to December, I want to count How many Records in each Month of a Year display it on a Label of every month.
What is the correct query to use?
What I have tried:
I tried And Declare Date.Today.Month and Date.Today.Year and use it in query, Select Count('ColumnName') from TblName where ColumnName = "& D.T.M &", but only counting all data in that table. Not filtering by each month.
You need to learn a lot more SQL - and since is your homework, that's why it was given to you.
Here's a SQL reference that will give you what you need to know - but you will need to learn it: SQL GROUP BY Statement[^]
You'll have to understand it - not very difficult and translate it into VB.NET.
这篇关于计算一年中每个月的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!