The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
mySQL Date Manipulation of joindate and Today's Date
I just want to create an SQL statement that will produce a list of users whose joindate is greater than or equal to Today's Date. And while I know a little bit about UNIX, mySQL is null. Can anyone tell me what I am am doing wrong, or is it all wrong? Seems like these would be really easy but I can't seem to add the 120 days to joindate correctly:
SELECT username, joindate FROM user WHERE DATE_ADD(joindate, 120) >= UTC_TIMESTAMP(); I have to assume that DATE_ADD isn't valid for adding 120 days to a date or UTC_TIMESTAMP isn't today's date. Or both? |
#2
|
||||
|
||||
Since it's just an integer column, you can use some simple math to do it:
Code:
WHERE joindate >= unix_timestamp(now()) - (86400 * 120); |
#3
|
|||
|
|||
That was awesomely fast and totally correct. You can close this thread! This might be a some kind of world record!
Thanks! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|