表里面的时间数据是这种格式: 2008-12-10 17:05:54.640我现在要筛选出 字段日期 与 用户选择的日期 相同的数据
private void btnSubmit_Click(object sender, EventArgs e)
{
DateTime time = Convert.ToDateTime(this.dateTimePicker1.Text);
this.cryAccount.SelectionFormula = "{ComputerAccountInfo.Xtime}=" + time; //筛选
this.cryAccount.RefreshReport(); //刷新报表
}
这样子报错,请问怎么做阿
我现在用这种还是报错阿..string time1 = Convert.ToDateTime(this.dtpFrom.Text).ToString();
string time2 = Convert.ToDateTime(this.dtpTo.Text).ToString();
this.crvAccount.SelectionFormula = "{ComputerAccountInfo.Xtime} between '" +time1+ " ' and '" + time2+"'" ;
提示剩余文本不是公式的一部分。
后来,只好用SQL过滤后,再传给报表
rtp.DataSource=ds;(ds,就是过滤后的DAtaSet)