表结构(number是自增列)
number datetime aa bb cc
1 2005-9-8 aaa aaa aaa
2 2004-9-8 bbb bbb bbb
3 2005-11-8 ccc ccc ccc
4 2005-9-14 ddd ddd ddd如果我要知道2005年的9月的数据,请问怎么写?
number datetime aa bb cc
1 2005-9-8 aaa aaa aaa
2 2004-9-8 bbb bbb bbb
3 2005-11-8 ccc ccc ccc
4 2005-9-14 ddd ddd ddd如果我要知道2005年的9月的数据,请问怎么写?
where [datatime]>='2005-09-01' and
[datatime]<='2005-09-30'
年份用numericUpDown1控件来选取
月份用comboBox1来选取
请问又改怎么写呢?
select * from 表 where month(datetime)=9 and year(datetime)=2005
年份用numericUpDown1控件来选取
月份用comboBox1来选取
是不是这样写
select * from table where month(datetime)='"+numericUpDown1.value+"' and year(datetime='"+comboBox1.Text+"')
年份用numericUpDown1控件来选取
月份用comboBox1来选取
是不是这样写
select * from table where month(datetime)='"+numericUpDown1.value+"' and year(datetime)='"+comboBox1.Text+"'
是不是这样?
应该改成这样:
select * from table where month(datetime)='"+numericUpDown1.SelectedValue.ToString()+"' and year(datetime)='"+comboBox1.SelectedValue.ToString()+"'