Yussi Ariefiyono
birthday reminder list asp.net
problem:
displaying list of bday boy/girl in next (30/ according to your own choice ) days from the current date.
solution:
im using the sql to select the date of birth, for displaying, you can use whatever you want, like gridview, datalist etc.
hereby the sql command:
SELECT DateOfBirth
FROM someTablename
WHERE (DateOfBirth < GETDATE()) AND (DATEDIFF(d, GETDATE(), DATEADD(yy, DATEDIFF(yy, DateOfBirth, GETDATE()), DateOfBirth)) BETWEEN
0 AND 30)
it will return the list of date of birth from the current date.
for reference of the sql command:
http://msdn.microsoft.com/en-us/library/aa258269%28SQL.80%29.aspx
| Print article | This entry was posted by yussi ariefiyono on August 3, 2009 at 3:55 pm, and is filed under sql. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |