asp+sql 按时间段查询
sql数据库wx表hdsj字段(datetime)hdsj字段中时间格式是2013-04-2317:17:37按开始日期,结束日期查询sql="select*fromwx...
sql 数据库 wx表 hdsj字段(datetime)
hdsj 字段中时间格式是2013-04-23 17:17:37
按开始日期,结束日期查询
sql="select * from wx where hdsj>=2013-04-21 and hdsj<=2013-04-21order by id desc" 展开
hdsj 字段中时间格式是2013-04-23 17:17:37
按开始日期,结束日期查询
sql="select * from wx where hdsj>=2013-04-21 and hdsj<=2013-04-21order by id desc" 展开
1个回答
展开全部
试试CDate
sql="select * from wx where hdsj>=CDate('2013-04-21') and hdsj<=CDate('2013-04-21') order by id desc"
sql="select * from wx where hdsj>=CDate('2013-04-21') and hdsj<=CDate('2013-04-21') order by id desc"
追问
Microsoft OLE DB Provider for SQL Server错误 '80040e14'
'CDate' 不是可以识别的 函数名。
/_bb/index.asp,行 57
追答
那分两步来写看行不行
mindate=CDate(“2013-04-21”)
maxdate=CDate(“2013-04-24”)
sql="select * from wx where hdsj>=mindate and hdsj<=maxdate order by id desc"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询