日期:2014-05-18 浏览次数:20816 次
sql_str = "select count(car_fee_id) from car_park_fee where car_fee_end convert(varchar(5) ,car_fee_end,108) between '09:00:01' and '10:00:00'and car_fee_flag = 2" + "union all select count(car_fee_id) from car_park_fee where car_fee_end and convert(varchar(5) ,car_fee_end,108) between '10:00:01' and '11:00:00'and car_fee_flag = 2 ; SqlConnection conn = new SqlConnection(fee_conn.sql_conn()); SqlCommand cmd = new SqlCommand(sql_str, conn); find_do = new SqlDataAdapter(); find_do.SelectCommand = cmd; ds = new DataSet(); try { find_do.Fill(ds, "rs"); d_report.Visible = true; } catch (System.Exception sqler) { MessageBox.Show("数据库不存在或用户名密码错误!"); return; } d_report.DataSource = ds.Tables["rs"]; d_report.Columns[0].HeaderText = "离开车辆数(辆)"; d_report.RowHeadersWidth = 120; d_report.Rows[0].HeaderCell.Value = "09:00-10:00"; d_report.Rows[1].HeaderCell.Value = "10:00-11:00";