三天后的生日提醒怎么做?

fkueyga6 2013-05-27 11:32:11
<%
if session("yonghulxid")<5 then sqlmx="and mx='"&session("mx")&"'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select distinct xm from [xy] where yanlsr=#"&dateadd("d",3,date())&"# "&sqlmx&"",conn,1,3
'阳历
%>
<%
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open "Select distinct xm from [xy] where yinlsr=#"&dateadd("d",3,""&curYear&"-"&curMonth&"-"&curDay&"")&"# "&sqlmx&"",conn,1,3
'阴历
%>
请问有没有截取月和日的函数,我说的是一起截,不是单个截(不是month(日期)和day(日期)),而是把月和日一起截取的
有没有像下面这样的写法?
<%
if session("yonghulxid")<5 then sqlmx="and mx='"&session("mx")&"'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select distinct xm from [xy] where 截取月和日(yanlsr)=#"&截取月和日(dateadd("d",3,date()))&"# "&sqlmx&"",conn,1,3
'阳历
%>
<%
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open "Select distinct xm from [xy] where 截取月和日(yinlsr)=#"&截取月和日(dateadd("d",3,""&curYear&"-"&curMonth&"-"&curDay&""))&"# "&sqlmx&"",conn,1,3
'阴历
%>
...全文
162 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
php_wsd 2013-05-28
  • 打赏
  • 举报
回复
sql="select * from xy where format(时间字段,'yyyy-m-d') = #"&(date()+3)&"#"
fkueyga6 2013-05-28
  • 打赏
  • 举报
回复
帮忙写一下呗,谢谢哈!
php_wsd 2013-05-28
  • 打赏
  • 举报
回复
再配合dateadd一起使用
php_wsd 2013-05-28
  • 打赏
  • 举报
回复
access数据库使用format函数 mssqlserver中使用convert函数

28,390

社区成员

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

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