表Ta
ID nian(整型) yue(整型)
1 2009 2
2 2009 5
3 2009 6
4 2009 8
5 2009 1
6 2009 3
7 2009 4
8 2009 6
9 2009 10
10 2009 12
11 2009 9
12 2008 7
13 2008 2
14 2008 5
15 2008 6
16 2008 8
17 2008 1
18 2008 3
19 2008 4
20 2008 6
21 2008 10
22 2010 1
23 2010 1
24 2010 1我用过这样的SQL但都不能得到应有的数据:SELECT * FROM chengben where nian (between 2008 and 2010) and yue< order by chengben.guishunian,chengben.guishuyue,t.CID
ID nian(整型) yue(整型)
1 2009 2
2 2009 5
3 2009 6
4 2009 8
5 2009 1
6 2009 3
7 2009 4
8 2009 6
9 2009 10
10 2009 12
11 2009 9
12 2008 7
13 2008 2
14 2008 5
15 2008 6
16 2008 8
17 2008 1
18 2008 3
19 2008 4
20 2008 6
21 2008 10
22 2010 1
23 2010 1
24 2010 1我用过这样的SQL但都不能得到应有的数据:SELECT * FROM chengben where nian (between 2008 and 2010) and yue< order by chengben.guishunian,chengben.guishuyue,t.CID
where nian*100+yue between 200812 and 201001
表Ta中存的数据为物品购买的归属年月, 我在程序中用Dropdownlist 做了四个下拉选择列表,分别为起始看月到终止年月。例如:怎样得到条件为nian大于2008年12月至2010年1月的数据?
表Ta
ID nian(整型) yue(整型)
1 2009 2
2 2009 5
3 2009 6
4 2009 8
5 2009 1
6 2009 3
7 2009 4
8 2009 6
9 2009 10
10 2009 12
11 2009 9
12 2008 7
13 2008 2
14 2008 5
15 2008 6
16 2008 8
17 2008 1
18 2008 3
19 2008 4
20 2008 6
21 2008 10
22 2010 1
23 2010 1
24 2010 1 我用过这样的SQL但都不能得到应有的数据:SELECT * FROM chengben where nian (between 2008 and 2010) and yue >=12 and yue <=1