Hey

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!

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.

Hey
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:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.