I need some more help with my program for my mum's indoor childs play center program.

I have a database with information about the child, including date of birth in format 01/01/0001.

I want the user to be able to click a button say 'btnjanuary' and for a list box to be filled with all of the members that have a birthday in january.

Im a bit stumped on ideas for this one, any ideas? Thank you!

8 Years
Discussion Span
Last Post by taylormsj

You didn't said which DB you're using and do you store birth dates in date type or in textual data type.

If the birth dates are stored as a text, you'll get matching records (January in this case) with following SQL select statement (just change correct table- and field-names):

SELECT * FROM <tablename> WHERE <birthdate> LIKE '%/01/%'

If the birth dates are stored in datetime type:

SELECT * FROM <tablename> WHERE (MONTH(<birthdate>) = 1)

This is for SQL Server 2005 but the same SQL syntax should work with most of the other DBs too.


I am using a .mdb access database file and the date is stored as date/time data type. I shall give the above code a try and see what happens thanks:)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.