Re: Select name, email where birthday = ??
Hello, I have a date field in my database Format is -MM-DD Once a day at 12:01AM a script is going to run that will Select name, email from users where birthday = ?? And the ?? Is where I am stuck, I don¹t care about the year at all, I just need to match on the month and day, how would I do this? - Scott HanedaTel: 415.898.2602 http://www.newgeo.com Fax: 313.557.5052 [EMAIL PROTECTED]Novato, CA U.S.A. You can rewrite the query the following way: Select name, email from users where substring (birthday from 6 FOR 5 )= ??; 6 is the position where it starts from, 5 is the length. _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Select name, email where birthday = ??
Where MONTH(birthday)=MONTH(now()) AND DAYOFMONTH(birthday)=DAYOFMONTH(now()) Adam Clauss [EMAIL PROTECTED] -Original Message- From: Scott Haneda [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 9:21 PM To: MySql Subject: Select name, email where birthday = ?? Hello, I have a date field in my database Format is -MM-DD Once a day at 12:01AM a script is going to run that will Select name, email from users where birthday = ?? And the ?? Is where I am stuck, I don¹t care about the year at all, I just need to match on the month and day, how would I do this? - Scott HanedaTel: 415.898.2602 http://www.newgeo.com Fax: 313.557.5052 [EMAIL PROTECTED]Novato, CA U.S.A. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql? [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Select name, email where birthday = ??
Try: select name, birthday from atable where month(birthday)=month(now()) and dayofmonth(birthday)=dayofmonth(now()); Marcel - Original Message - From: Scott Haneda [EMAIL PROTECTED] To: MySql [EMAIL PROTECTED] Sent: Tuesday, May 27, 2003 10:20 PM Subject: Select name, email where birthday = ?? Hello, I have a date field in my database Format is -MM-DD Once a day at 12:01AM a script is going to run that will Select name, email from users where birthday = ?? And the ?? Is where I am stuck, I don¹t care about the year at all, I just need to match on the month and day, how would I do this? - Scott HanedaTel: 415.898.2602 http://www.newgeo.com Fax: 313.557.5052 [EMAIL PROTECTED]Novato, CA U.S.A. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]