实在没辙了·~帮我看下,生日提醒问题

91jk 2009-05-05 11:12:35

sql = "select * from kedate where datediff('d',cstr(year(date())) + '-' + cstr(month(Birthday)) + '-' + cstr(day(Birthday)),date())<="&remindDays &" and datediff('d', cstr(year(date())) + '-' + cstr(month(Birthday)) + '-' + cstr(day(Birthday)),date())>=0 order by ID desc"


数据库ACCESS的,birthday字段格式是时间型的。。。但是就是老提示“无效的 null 使用
”,而且打印SQL也打印不出来,请帮我指点指点,谢谢了·~~
...全文
101 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
91jk 2009-06-04
  • 打赏
  • 举报
回复
谢谢,我自己做出来了
  • 打赏
  • 举报
回复
直接打印
sql = "select * from kedate where datediff('d',cstr(year(date())) + '-' + cstr(month(Birthday)) + '-' + cstr(day(Birthday)),date()) <="&remindDays &" and datediff('d', cstr(year(date())) + '-' + cstr(month(Birthday)) + '-' + cstr(day(Birthday)),date())>=0 order by ID desc"
Response.Write sql
Response.End

就知道了
ACMAIN_CHM 2009-05-06
  • 打赏
  • 举报
回复

Birthday 估计中空值吧。
Element 2009-05-06
  • 打赏
  • 举报
回复
帮忙顶一下!
sunrainnet 2009-05-06
  • 打赏
  • 举报
回复
Birthday变量里面有没有值?你先用
Response.Write("生日:" & Birthday)
Response.End

试试把Birthday写出来看看有没有问题吧

28,391

社区成员

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

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