时间查询处理
http://www.cnyqrc.com/jobmore.asp
象这里的“查询工作”这样的查询代码怎么写呀。
我一直不知道这个发布日期在查询中应该怎么处理
麻烦各位高手了,假设发布日期在数据库中的字段为sendtime,完整的语句应该怎么写呀?
sql="select * from aaa where a=b and ..."
...里的时间处理应该怎么写呢?
http://www.cnyqrc.com/jobmore.asp
象这里的“查询工作”这样的查询代码怎么写呀。
我一直不知道这个发布日期在查询中应该怎么处理
麻烦各位高手了,假设发布日期在数据库中的字段为sendtime,完整的语句应该怎么写呀?
sql="select * from aaa where a=b and ..."
...里的时间处理应该怎么写呢?
发布日期一般都用来排序用的吧
我这里打不开那个网页
也帮不了你什么
sql="select * from aaa where a like '%" & 查询代码 & "%' order by sendtime desc"
使用dateAdd()函数或者dateDiff()函数,具体可以查看sqlServer帮助
如查询最近15天内的:
select * from aaa where a=b and sendtime>dateAdd(d,-15,getDate())
sql="select * from aaa where a=b and '"&date()&"'-sendtime<="&request("qixian")&"
request("qixian") 是获取的字段
sql="select * from aaa where a=b and DATEDIFF(hh,sendtime,getdate())<=24*30"