怎么定义从选定年的第一天开始统计数据?比如选择2012年,11月,那么生成出生人数就是从2012.1.1到2012.11.30之间出生的人数,请教各位老师帮我修改下代码,谢谢
Dim village As WinForm.ComboBox = e.Form.Controls("选择村级单位")
village.Combolist = DataTables("出生").GetCombolistString("单位名称")
Dim year As WinForm.ComboBox = e.Form.Controls("年")
Dim month As WinForm.ComboBox = e.Form.Controls("月")
Dim csrq As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim FirstDay As Date = New Date(year.Text,month.Text,1) '第一天
Dim LastDay As Date = New Date(year.Text,month.Text,Date.DaysInMonth(year.Text,month.Text)) '最后一天
Dim yearDay As Date = New Date(year.Text,1) '第一天
r("出生_总数") = DataTables("出生").Compute("Count(_Identify)", filter & " And 子女出生日期 >= #" & yearDay & "# And 子女出生日期 <= #" & LastDay & "#" )
r("出生_政策内_一孩") = DataTables("出生").Compute("Count(_Identify)", filter & " And 子女政策属性 = '政策内' And 子女孩次 = 1 And 子女出生日期 >= #" & yearDay & "# And 子女出生日期 <= #" & LastDay & "#" )
r("出生_政策内_二孩") = DataTables("出生").Compute("Count(_Identify)", filter & " And 子女政策属性 = '政策内' And 子女孩次 = 2 And 子女出生日期 >= #" & yearDay & "# And 子女出生日期 <= #" & LastDay & "#" )
此主题相关图片如下:qq图片20130619063422.jpg