在到期日前一个月显示消息 [英] display message one month before the expiry date

查看:83
本文介绍了在到期日前一个月显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,



我想在到期日前1个月显示到期消息。

如果是到期日期超过一个月与今天相比。



在sql数据库中,我使用字段作为到期日期。



在我的网页上我有一个标签显示到期日。



谢谢。

解决方案

< blockquote>见下面,类似的问题。



程序计算c#.net 到期日之前的1个月[ ^ ]


我可以告诉你2个简单的解决方案一个是你可以登记你的Db并返回Expiredate和status为true或fales,例如,如果有效期是>然后30天+今天的日期然后它应该返回假。如果今天的日期增加30天是< expirey date然后返回true并显示你的警告信息。



这里是你的示例SQL查询。



 声明  @ Expireye   datetime 
@ eDate datetime ;

选择 @ Expireye = ' 12/25/2014 08:00:00'


选择 @ Expireye as expireDate,getdate() as todaysdate,DATEADD(day, 30 ,getdate()) as TodatedatePlus30days ,
case 何时 DATEADD(day, 30 ,getdate())< @ Expireye 然后 ' False' Else ' true' END as ExpiryStatus


hi frnds,

I want to display the expiry message 1 month before the expiry date.
It should not display if the expiry date more than one month compare to todays date.

In sql database, am using field as expiry date.

on my webpage i have a label to display the expiry date.

Thanks.

解决方案

See below , similar question .

program To Calculate The 1 month Before The expiry Date in c#.net[^]


I can tell you 2 simple solution one is you can check in you Db and return the Expiredate and status as true or fales for example if expiry date is > then 30 days + todays date then it should return the false .If todays date add 30 days is < expirey date then return true and display your warning message.

here is sample SQL query for you.

declare @Expireye datetime,
        @eDate datetime;
 
select  @Expireye = '12/25/2014 08:00:00' 
  

select  @Expireye as expireDate,getdate() as todaysdate,DATEADD(day,30,getdate())as TodatedatePlus30days,
case when DATEADD(day,30,getdate()) < @Expireye Then 'False' Else 'true' END as ExpiryStatus


这篇关于在到期日前一个月显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆