Click here to Skip to main content
15,909,205 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i m using asp.net and sql server 2008 r2..
i have a database where i had stored dob of many users and i want that a popup should blink automatically whenver someone's birthday comes..
means SYSDATETIME should compare DOB and if equal thn display message..
i dnt know hw to do so...
please help me out
Posted
Comments
Ramug10 3-Apr-14 8:47am    
you want to show list of users who DOB is systemdate in a popup right.

Simple do one thing that when ever any user came, Check if the Date part of users equals to today system date. Here is the query

SQL
Select Name from User where DATEADD(D, 0, DATEDIFF(D, 0, DOB)) = DATEADD(D, 0, DATEDIFF(D, 0, '1989-01-08 00:00:00.000'))


Here 'DATEADD(D, 0, DATEDIFF(D, 0, DOB))' express results in matching the date part only.

All the best!!
 
Share this answer
 
At home page you can set a Pop Up or ModelPopUp Ajax on the condition if that user have birthday today.
Date dt = coming from db for this user
day = dt.day;
month = dt.month;
if(day = DateTime.Now().Day && month == DateTime.Now().month)
{
// Show ModelPopUp or popup with some text
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900