读书人

VB.NET中按日期分类汇总有关问题

发布时间: 2012-01-09 21:05:42 作者: rapoo

VB.NET中按日期分类汇总问题
各位大哥,我是初学者
我在VB.NET中做了一个按日期查询汇总,但是总是提法我的查询日期字段不在GROUP BY 中,但是如果把它加进去那就没有汇总啊,请问怎么样才能解决啊,对了,还有一个问题,我的日期是直接输入到文本框中的,有什么方法可以直接选择进去,谢谢了,在线等
cmd.CommandText += "where purchaser like '% " + purchaser + "% ' and material_specification like '% " + specification + "% ' "
cmd.CommandText += " and material_name like '% " + name + "% ' "
cmd.CommandText += " and kind like '% " + kind + "% ' "
cmd.CommandText += " and in_time between ' " + begint + " ' "
cmd.CommandText += " and ' " + endt + " ' group by material_name,material_specification,purchaser,kind ,in_time order by purchaser,material_name,material_specification "
cmd.Connection = conn

如果不加IN_TIME就报错

[解决办法]
1. in_time> = ' " + begint + " ' " and in_time <= ' " + endt + " '
2. 用DataTimePicker

读书人网 >VB Dotnet

热点推荐