這樣? select * from table1 where col1 between '2011-7-1' and '2011-9-10' and col2 between '2011-7-1' and '2011-9-10' and col3 between '2011-7-1' and '2011-9-10'
能不能写成select * from table where年+月+日 between 2011-7-1 and 2011-9-1的类似形式
select * from table1 where col1 between '2011-7-1' and '2011-9-10' or col2 between '2011-7-1' and '2011-9-10' or col3 between '2011-7-1' and '2011-9-10其中一列滿足都顯示用 or
select * from table where CAST(RTRIM(年)+right(100+月,2)+right(100+日,2) AS DATETIME) between '2011-7-1' and '2011-9-1'
string sql_str = "select * from TestData " +" where CAST(RTRIM(Year)+right(100+Month,2)+right(100+Date,2) AS DATETIME) between '" + Session["date1"].ToString() + "' and '" + Session["date2"].ToString() + "'" 还是不对啊
select * from Table where 时间 between 开始时间 and 结束时间
string sql_str = "select * from TestData where CAST(RTRIM(Year)+right(100+Month,2)+right(100+Date,2) AS DATETIME) between '" + Session["date1"].ToString() + "' and '" + Session["date2"].ToString() + "'"
select * from tb where dt between '2011-7-1' and '2011-9-10'
select * from table1 where col1 between '2011-7-1' and '2011-9-10'
and col2 between '2011-7-1' and '2011-9-10'
and col3 between '2011-7-1' and '2011-9-10'
or col2 between '2011-7-1' and '2011-9-10'
or col3 between '2011-7-1' and '2011-9-10其中一列滿足都顯示用 or
select * from table where CAST(RTRIM(年)+right(100+月,2)+right(100+日,2) AS DATETIME) between '2011-7-1' and '2011-9-1'
还是不对啊
select * from Table where 时间 between 开始时间 and 结束时间
select * from tb where dt between '2011-7-1' and '2011-9-10'
我的目的是取出数据库中Session["date1"].ToString和Session["date2"].ToString这两个日期之间的数据。