Sql Birthdate Query – Query Examples

Sql Birthdate Query

In this post you will learn how to find birth date of customer or student. We will use getdate(), month and day functions in the query. Month function returns back the month of the date.(1-12 values). Day function returns back the day of the date. Getdate() function returns the moment the query has run.

TO DOWNLOAD THE SAMPLE LİBRARY DATABASE CLICK

Example 1: List students whose birth date is today

Result for 03 Nowember 2018:

Example 2: List students whose birth date is tomorrow

Result for 03 Nowember 2018:

Example 3: List students whose birth date is in next week

Result for 03 Nowember 2018:

NOT:: The query above not exactly true. Not works on leap years and the last week of year. The query below is long but exactly true;

Result for 03 Nowember 2018

YOU MAY WANT TO SEE OUR ALL EXAMPLES PAGE, THEN CLICK HERE

 

About the author

Thomas Brown

Leave a Comment

%d bloggers like this: