TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Calculate Days Remaining For User Birthday Countdown
Akshay Phadke
Jul 10
2016
Code
1
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
USE [BloodBankManagement]
GO
/****** Object: StoredProcedure [dbo].[sp_DonorBdayEvent] Script
Date
: 7/8/2016 12:57:20 PM ******/
SET
ANSI_NULLS
ON
GO
SET
QUOTED_IDENTIFIER
ON
GO
ALTER
PROCEDURE
[dbo].[sp_DonorBdayEvent]
AS
BEGIN
--Donor Marriage aniversary
select
DonorID,DonorIDValue,
Name
,DonorMarrAnvDate,DATEDIFF(
day
,GETDATE(),DonorMarrAnvDate)
as
RemainingDaysForMar
from
dbo.DonorRegister
where
ActiveFlag=1
and
CONVERT
(
DATE
, DonorMarrAnvDate)
between
CONVERT
(
DATE
, getdate())
and
CONVERT
(
DATE
, getdate()+12)
--Donor Marriage Bday
select
DonorID,DonorIDValue,
Name
,DOB,DATEDIFF(
day
,GETDATE(),DOB)
as
RemainingDaysForDOB
from
dbo.DonorRegister
where
CONVERT
(
DATE
, DOB)=
CONVERT
(
DATE
, getdate())
and
ActiveFlag=1
END
Calculate Days
Birthday Countdown
SQL Server