Sign-up....

时间查询处理

http://www.cnyqrc.com/jobmore.asp

象这里的“查询工作”这样的查询代码怎么写呀。

我一直不知道这个发布日期在查询中应该怎么处理

麻烦各位高手了,假设发布日期在数据库中的字段为sendtime,完整的语句应该怎么写呀?

sql="select * from aaa where a=b and ..."

...里的时间处理应该怎么写呢?

[187 byte] By [msdn] at [2007-8-14 9:13:02]
# 1 Re: 时间查询处理

发布日期一般都用来排序用的吧

我这里打不开那个网页

也帮不了你什么

sql="select * from aaa where a like '%" & 查询代码 & "%' order by sendtime desc"

piaomiao_jxz at 2005-5-11 15:04:10 >
# 2 Re: 时间查询处理

使用dateAdd()函数或者dateDiff()函数,具体可以查看sqlServer帮助

如查询最近15天内的:

select * from aaa where a=b and sendtime>dateAdd(d,-15,getDate())

baiyunfei at 2005-5-11 15:10:57 >
# 3 Re: 时间查询处理

sql="select * from aaa where a=b and '"&date()&"'-sendtime<="&request("qixian")&"

request("qixian") 是获取的字段

aspme at 2005-5-11 15:45:59 >
# 4 Re: 时间查询处理

sql="select * from aaa where a=b and DATEDIFF(hh,sendtime,getdate())<=24*30"

wxf0104 at 2005-5-11 16:49:06 >

Web

All Classified