Jump to content

Recommended Posts

Either use the mysql MONTH() and DAY() functions or the DATE_FORMAT() function to get just the month and day from your date of birth column and then use a BETWEEN comparison to test for the min and max values you want.

really sorry guy.  I know a bit how to use month() day() and DATE_FORMAT() actually, but i really

can not figure out how to write the sql statement for this case!  Could you please write an example?

 

Example: SELECT mem_dob FROM `membership` WHERE mem_dob BETWEEN .......

 

I really does not know how to continue at the end

 

Thank in advance.

 

After try for several hours, if finallly come out with this:

 

SELECT *

FROM `membership`

WHERE date_format( mem_dob, '%m-%d' )

BETWEEN date_format( '2009-02-03', '%m-%d' )

AND date_format( '2009-03-15', '%m-%d' )

 

Could someone please tell me will this code work correctly? I have try it seem to be correct but may be

there are some case that i do not considered.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.