计算日期差异如果日期为= 15天,则发送邮件 [英] Calculating datediffernce If the date is =15 days then send mail
本文介绍了计算日期差异如果日期为= 15天,则发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
计算日期差.如果日期是= 15天,请发送邮件.
从样本中选择*,其中datediff(day,StartDate,getdate())=''15''
它检索整个数据,从不检查条件.
帮助pl
Hello all,
Calculate the datediffernce. If the date is =15 days then send mail.
select * from Sample where datediff(day,StartDate,getdate())=''15''
It retrieve the whole data, never check the condition.
Help pl
推荐答案
尝试以下操作:
Try this:
SELECT * FROM Sample WHERE DATEDIFF(DAY, StartDate, GETDATE()) = 15
使用这种类型:
use this type :
select * from Sample where datediff(d,StartDate,getdate())=15
希望有帮助
hope this help
在这里你
如何从SQL Server发送电子邮件? /a> [ ^ ](选中要安排邮件部分)
Here you go
How do I send e-mail from SQL Server?[^](Check To schedule mail section)
这篇关于计算日期差异如果日期为= 15天,则发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文