ASP时间查询语句

ASP 1527 0 2013-02-16

ASP时间查询语句

一、时间段Access:
sql="select * from news where addtime between #"&begin_time&"# and #"&end_time&"# "

sql="select * from news where addtime >= #"&begin_time&"# and addtime <= #"&end_time&"# "

二、统计和查询
set rs=conn.execute=("select sum(price) from table")   
response.write rs(0)

上一篇:ASP设置/读取cookies函数

下一篇:ASP查看源代码时换行符

讨论数量:1

天涯网魂 3 杠 5 星2014-03-10 19:51:44

如是SQL Server数据库,时间段查询应该是这样:

sql="select * from news where addtime between '"&begin_time&"'  and '"&end_time&"'"

也就是把“#”换成“'”

请先登录再发表讨论。 2024-05-05

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链