请问如何在数据库中按月份查找
Private Sub Command1_Click() '“查询”按钮If Combo1.Text = "" Then
MsgBox "请在列表框中选择项目", , "信息提示"
Combo1.ListIndex = 0
Combo1.SetFocus
Exit Sub
Else
Adodc1.RecordSource = "select * from guest where month(时间) = '2005-'+ ' " _
+ Trim(Combo1.Text) + " ' order by 时间"
Set DataGrid1.DataSource = Adodc1
End If
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * from guest order by 编号"
Set DataGrid1.DataSource = Adodc1
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo1.AddItem "3"
Combo1.AddItem "4"
Combo1.AddItem "5"
Combo1.AddItem "6"
Combo1.AddItem "7"
Combo1.AddItem "8"
Combo1.AddItem "9"
Combo1.AddItem "10"
Combo1.AddItem "11"
Combo1.AddItem "12"
Combo1.Text = ""
End Sub
以上是我看书抄出来的一段代码
改成我需要的东西了
然后运行程序以后
数据库会全部显示出来
不会执行按月查找
请问我需要改什么地方
最好后面加单引号注释一下
我太菜了
谢谢