You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 52 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Help with SQL statement to extract birthdate [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
alinka
Sergeant
Sergeant


Joined: Jan 20, 2004
Posts: 80


PostPosted: Wed Feb 02, 2005 10:24 am Reply with quoteBack to top

Hi guys,

In my nuke_users table, I have been gathering birthdates. It's sitting in field "birth" as a date 0000-00-00 (YYYY-MM-DD)

I would like to write a block, which will show which users have a birthday today. I am a NEWBIE to sql statements. I have figured out how to extract all users with their ids and birthdays with this statement:

SELECT id, ffusername, birth FROM nuke_users

But I don't know how to extract users who have a birthday TODAY. I know I need to extract a month and date and then see if its equal to todays month and todays date, but I don't know how to extract month and date from a field which has YYYY-MM-DD together all in one field and then how to write it so it says its equal to today's month/date.

If there are any SQL gurus out there, please kindly help. THANKS!
Find all posts by alinkaView user's profileSend private message
ss-snake
Private
Private


Joined: Nov 17, 2004
Posts: 39


PostPosted: Fri Apr 08, 2005 9:22 am Reply with quoteBack to top

try "SELECT id, ffusername, birth FROM nuke_users where birth=SYSDATE"

I think the MySQL code for the current date is "SYSDATE". If im wrong, do a quick little search on google.

This will compare your the entries in your "birth" field to the current system date and extract only those dates that match the system date.
Find all posts by ss-snakeView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.541 Seconds - 376 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::