List:General Discussion« Previous MessageNext Message »
From:Inandjo Taurel Date:May 28 2003 1:46pm
Subject:Re: Select name, email where birthday = ??
View as plain text  

>Hello, I have a date field in my database
>Format is YYYY-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 Haneda                                Tel: 415.898.2602
>http://www.newgeo.com                       Fax: 313.557.5052
>scott@stripped                            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

Thread
How to secure a MySQL database from people with physical accessmos27 May
  • Re: How to secure a MySQL database from people with physical accessJoel Rees28 May
    • Select name, email where birthday = ??Scott Haneda28 May
      • RE: Select name, email where birthday = ??Adam Clauss28 May
      • Re: Select name, email where birthday = ??Marcel Forget28 May
RE: How to secure a MySQL database from people with physical acce ssDavid Brodbeck27 May
RE: How to secure a MySQL database from people with physical acce ssmos27 May
RE: How to secure a MySQL database from people with physical acce ssmos27 May
  • Re: How to secure a MySQL database from people with physical acce ssMichael T. Babcock28 May
Re: Select name, email where birthday = ??Inandjo Taurel28 May