Gery_Atric
Posts: 7
|
| Posted: 08/13/2009, 1:16 PM |
|
I would like to make a selection from D-B table based on the current date ,
lets say I have a 1000 dates of birth in my table and I want to display who's birthday it is to day .bearing in mind I can only use the day and month like so dd/mm .
My fields are name , birthday , current_date.
so how would I formulate my where clause .
thanks
GERY
|
 |
 |
damian
Posts: 838
|
| Posted: 08/13/2009, 5:44 PM |
|
http://forums.codecharge.com/posts.php?post_id=64203&s_keyword=birthday
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
Gery_Atric
Posts: 7
|
| Posted: 08/14/2009, 10:03 AM |
|
Thanks for the reply damian
I have played around with your birthday code and come up with this .
I am using sql as my Data Source so here is the select
SELECT member_name, dob from members WHERE dayofmonth(dob) >=dayofmonth(now()) AND month(dob) = month(now())
This returns all dates from now() "today" to the end of the current month ,
Now how could I refine it to return today only .
thanks again for your help
GERY
|
 |
 |
Gery_Atric
Posts: 7
|
| Posted: 08/14/2009, 3:33 PM |
|
Cracked it with the following
SELECT member_name, dob from 'members' WHERE dayofmonth('dob') >=dayofmonth(now()) AND month('dob') = month(now())
|
 |
 |
|