注册 登录
编程论坛 ASP技术论坛

排序问题

inking0801 发布于 2011-04-23 00:37, 545 次点击
sqL="select * FROM new  where  lb="&id
  然后怎么让它按时间排序
5 回复
#2
ywyql_842011-04-23 10:14
今天  sqL="select * FROM new  where  lb="&id and 时间字段名 like
'%"&date()&"%'

昨天 sqL="select * FROM new  where  lb="&id and 时间字段名 like '%"&DateAdd("d", -1, date())&"%'

前天 sqL="select * FROM new  where  lb="&id and 时间字段名 like '%"&DateAdd("d", -2, date())&"%'
#3
DanYang_dan2011-04-23 10:45
sqL="select * FROM new  where  lb="&id&" order by times

times是数据库时间字段
#4
DanYang_dan2011-04-23 10:47
sqL="select * FROM new  where  lb="&id&" order by times desc

#5
zhongx2011-04-23 21:07
以下是引用DanYang_dan在2011-4-23 10:47:06的发言:

sqL="select * FROM new  where  lb="&id&" order by times desc
建议
#6
lxd09802011-04-24 22:35
在表里面再加一个time字段, 保存后.再用SQL语句:sqL="select * FROM new  where  lb="&id&" order by times desc
1