这是我的第一篇文章,所以请温柔:)
我正在为我的大学项目进行自动注册。我使用 RFID 扫描仪扫描学生 ID 标签和在 Access 中创建的数据库。我使用 C# 和 dataGridView 来显示我的数据库表。
我正在尝试编写一个 SQL 查询,它将通过将保存在数据库中的日期/时间与当前日期/时间相比较,为每个扫描的 tagID 返回一个当前 sessionID。我的问题是:我该怎么做?我用谷歌搜索了我的问题,但找不到我正在寻找的答案(可能是由于我的表格结构复杂)。也许你能帮上忙。
我的表格结构如下:
Student
fields Name -> Data type
=========================
(PK) tagID -> number
studentID -> text
(FK) courseID -> number
studentName -> text
Course
=========================
(PK) courseID -> number
courseName -> text
CourseModule
=========================
(FK) courseID -> number
(FK) moduleID -> text
Module
=========================
(PK) moduleID -> text
courseName -> text
ModuleSession
=========================
(FK) moduleID -> text
(FK) sessionID -> text
Session
=========================
(PK) sessionID -> text
sessionStartDate -> date
sessionTimeStart -> time
sessionTimeEnd -> time
Attendance
=========================
(FK) tagID -> number
(FK) sessionID -> text
(FK) scanningTime -> date/time