954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Date functions

I'm doing an code the would list events entered by people and it's sorted by date, what I want it to do though is to list out only those who's starting dates haven't passed yet. How should I build the query? Could it be as simple as "SELECT * FROM events WHERE sort_date < NOW()" ?

StrikeFreedom
Newbie Poster
17 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This is an SQL question, which belongs in the database section.

If you want to find all the records that have dates in sort_date that are after the current date, use the following query:

SELECT * FROM events WHERE sort_date>NOW()


Notice that you want the sort_date to be greater than NOW(), not less than.

chrisbliss18
Posting Shark
917 posts since Aug 2005
Reputation Points: 38
Solved Threads: 25
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You