这段代码有什么问题,无法实现目标

ycqj78 2008-03-31 01:44:37
if (Show_date=1 and DateDiff("d",CDate(rs("time")),Now())>0 And DateDiff("d",CDate(rs("time")),Now())) <= 3 then
response.write " "
response.write "<font color='#FF0000'>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write "</font>"
else
response.write " "
response.write "<font color='#808080'>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write "</font>"
end if
刚刚学习,问题太多,有时都搞不明白
...全文
92 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
kildare43 2008-04-01
  • 打赏
  • 举报
回复
貌似和这段代码没什么关系,看图上是因为右边多了一个白色框,应是代码其它地方影响
ycqj78 2008-04-01
  • 打赏
  • 举报
回复
youg有高手看一下么,急用
ycqj78 2008-03-31
  • 打赏
  • 举报
回复
原来的代码是这样的
if Show_date=1 then
response.write " "
response.write " <font color='#808080'>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write " </font>"
end if
没改之前的
[URL=http://img359.imageshack.us/my.php?image=24852174px7.jpg][IMG]http://img359.imageshack.us/img359/2610/24852174px7.th.jpg[/IMG][/URL]

这是我改的
if Show_date=1 and DateDiff("d",datevalue(rs("time")),datevalue(Now()))>0 And DDateDiff("d",datevalue(rs("time")),datevalue(Now())) <= 3 then
response.write " "
response.write " <font color='#FF0000'>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write " </font>"
else
response.write " "
response.write " <font color='#808080'>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write " </font>"
end if
改了之后的页面
[URL=http://img380.imageshack.us/my.php?image=71458800ye2.jpg][IMG]http://img380.imageshack.us/img380/9249/71458800ye2.th.jpg[/IMG][/URL]

这段代码是Function.asp文件中的一部分,在1356~1361行
http://www.fs2you.com/files/80e11830-fe6c-11dc-97da-0014221b798a/

请指导一下,困扰我很久了
underone 2008-03-31
  • 打赏
  • 举报
回复
怎么错位了?
ycqj78 2008-03-31
  • 打赏
  • 举报
回复
好像还是不对,错位了,而且没有日期了
underone 2008-03-31
  • 打赏
  • 举报
回复
DateDiff("d",datevalue(rs("time")),datevalue(Now()))
ycqj78 2008-03-31
  • 打赏
  • 举报
回复
>3天为灰色,<=3天为红色,按上面这个就会出现错位的情况
underone 2008-03-31
  • 打赏
  • 举报
回复
就是颜色的变化?
underone 2008-03-31
  • 打赏
  • 举报
回复
你要实现什么啊?
ycqj78 2008-03-31
  • 打赏
  • 举报
回复
有人帮我看一下吗?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧