INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

*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

function date

function date

(OP)
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

RE: function date

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);

RE: function date

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

RE: function date

hehe,

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

thanks for the *BANG*

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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!

Resources

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