Welcome Guest, Not a member yet? Register   Sign In
sql query for days until next birthday?
#4

[eluser]sophistry[/eluser]
i like the PHP solution because it is more readable. thanks, nick.

@shiggins - could you elaborate? i've been down multiple paths to get to this, so if you have some code to share that would be great!

here's how you can use DATEDIFF to get "age in days", but it quickly becomes more complicated when you want "days until next birthday"

Code:
$this->db->select("short_name, DATEDIFF(CURDATE(), birthday) AS age_in_days");


Messages In This Thread
sql query for days until next birthday? - by El Forum - 02-06-2009, 11:33 AM
sql query for days until next birthday? - by El Forum - 02-06-2009, 12:48 PM
sql query for days until next birthday? - by El Forum - 02-06-2009, 12:58 PM
sql query for days until next birthday? - by El Forum - 02-06-2009, 01:18 PM
sql query for days until next birthday? - by El Forum - 10-01-2009, 02:12 PM
sql query for days until next birthday? - by El Forum - 10-19-2009, 08:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB