.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SQL Query >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Get Birthday reminder SQL Query by ignoring year

Posted By:Amit Mehra       Posted Date: August 26, 2009    Points: 10    Category: SQL Query    URL: http://www.dotnetspark.com  
 

Get Birthday reminder Sql Query ignoring year.


This code example is useful to get all the rows from SQL Server between tow given dates and ignoring year. This is useful when you want to get all the records for next week, 15 Days , one month or your specified date.


In this example we have to use GetDate() DatePart() function to to fetch all the records falling between specified dated.

select * from  where datepart(dayofyear,
) between datepart(dayofyear,getdate()) and
datepart(dayofyear, dateadd(day,15,getdate()))
Thanks
Amit



     

Further Readings:

Responses
Author: Syed Shakeer Hussain         Company URL: http://www.dotnetspark.com
Posted Date: August 27, 2009

Rocking Query.
This type of query will usefull in real time work
Author: Amit Mehra         Company URL: http://www.dotnetspark.com
Posted Date: August 27, 2009

Thanks Syed...This post is inspired by your question that you have asked in the forum couple of days back.

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend