Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

dcampo (Programmer) (OP)
6 Oct 06 20:14
Hi all

Sorry, I don't write very well the english!!!

I have in my Database a table called Users. I have a field of containt the date of birth of all the users.

If I want to show the users that TODAY is their birhtday or the users that in the MONTH are birthday....

For example:

TODAY:
Linda McCantion        3 October
Daniel Campo           3 October
.
.

MONTH (example October)
Linda McCantion        3 October
Daniel Campo           3 October
Lady Rushell           5 October
Andrew Lennon          20 October
.

How can I do it? Any sentence for compare the date of birth with the date of today??

please, help me!!!

Thanks
mberni (IS/IT--Management)
9 Oct 06 4:52
to select the users who have birthday today:

CODE

select * from yourtable
where date_of_birth = today;

to select the users who have birthday in the current month:

CODE

select * from yourtable
where month(date_of_birth) = month(today)
  and year(date_of_birth)  = year(today);
PHV (MIS)
1 Mar 07 18:53
Today:
SELECT * FROM Users
WHERE DAY(DateOfBirth)=DAY(TODAY) AND MONTH(DateOfBirth)=MONTH(TODAY)

Month:
SELECT * FROM Users
WHERE MONTH(DateOfBirth)=MONTH(TODAY)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

mberni (IS/IT--Management)
2 Mar 07 2:25
hehe,

true, birthdays do not occur only once in life :))

thanks for the *BANG*

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close