如何在特定月份显示活动课程/记录 [英] How to show active courses/records in specific month
问题描述
大家好,
我想列出特定月份的所有活动课程。
作为基础数据我有例如:
Course1,2015年1月11日开始,2016年1月31日结束
课程2,开始时间2015年12月12日,2016年12月31日结束
Course3,开始1-1-2016,结束31-3-2016
等
我有一个组合框用于选择月份和用于输入年份的免费文本框。
我想要的是,如果用户选择2015年12月的列表显示该月和下个月的活动课程:
2015年12月--- 2016年1月
课程1 ---课程1
课程2 ---课程3
>
我相信它应该相当容易,但是不能完成它。无论我尝试创建什么样的查询,它总是导致显示所有课程之后,或者在特定日期之前显示所有课程,或者根本不显示任何课程。但绝不是所有人都活跃某个月和下个月的课程。
使用Access 2010.
是否有人愿意提供帮助?谷歌搜索没有给我答案: - (
Hi all,
I want to list all active courses for a specific month.
As base data I have for example:
Course1, Start 1-11-2015, End 31-1-2016
Course2, Start 1-12-2015, End 31-12-2016
Course3, Start 1-1-2016, End 31-3-2016
etc
I have a combo box for selecting month and a free text box for inputting year.
What I want is if a user selects december 2015 to have a list showing the active courses for that and the next month:
december 2015 --- january 2016
Course1 --- Course1
Course2 --- Course3
I''m convinced it should be fairly easy, but just can''t get it done. Whatever query I try to create, it always results in either showing all courses after, or all courses before a certain date, or no courses at all. But never all "active" courses in a certain month and the next month.
Using Access 2010.
Is there anyone willing to assist? Googling brought me no answer :-(
推荐答案
让我们看看我们是否正确:
您的数据具有以下结构:
[tblCourse]
[tblCourse]![PK](自动编号)
[tblCourse]![CName](文字(255))
[tblCourse]![CStarts](日期/时间)
[tblCourse]![CEnds](日期/时间)
Let see if we have this correct:
Your data has this structure:
[tblCourse]
[tblCourse]![PK] (autonumber)
[tblCourse]![CName] (Text(255))
[tblCourse]![CStarts] (Date/Time)
[tblCourse]![CEnds] (Date/Time)
非常感谢您的回复。您的表格绝对正确。
至于您的代码,它确实显示我1秒ingle月。
我试图达到的目标/结果是一个表格,显示所选月份和下个月的课程。
Thank you very much for your reply. You have the table absolutely correct.
As for your code, it does show me 1 single month.
The goal/ result I am trying to reach though is a table that shows the courses for the selected month and the next month.
对不起,误读了部分问题.... :)
如果课程属于一个月,那么这个月是活跃的,还是有最少的天数?
你提到我们参数的cbox和textbx。
>
让我睡在上面因为它已经很晚/很早了我需要小睡(Z_Z) - 兔子和NeoPa在SQL上的速度比我快,所以他们可能有东西:)
ON第一次脸红看起来像我的每月查询;但是,我的数据有点不同,
Sorry, misread part of the question.... :)
If the course falls in to the month at all then it''s active for the month or is there a minimum number of days?
You mentioned the cbox and textbx for our parameters.
Let me "sleep on it" as it''s very late/early here and I need a nap (Z_Z) - Rabbit and NeoPa are faster on the SQL than I am so they may have something :)
ON first blush this looks like my Monthly query; however, my data is a bit different,
这篇关于如何在特定月份显示活动课程/记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!