MySQL Forums
Forum List  »  Newbie

Compare dates within a WHERE
Posted by: Tevis Woods
Date: August 27, 2011 02:23PM

Ok so I would like to compare the current time with the time stored in each row to determine those entries that were completed within the last three days. This is what I was trying, but I'm guessing you can't do a WHERE like that.

"SELECT firstname,lastname,specialty FROM referred WHERE DATEDIFF(NOW(), timeCompleted) < 3"

Anyways, please let me know if this can work, or if not, what the best way to do this is. PS: I'm using visual c# 2010. Thanks in advance!

Options: ReplyQuote


Subject
Written By
Posted
Compare dates within a WHERE
August 27, 2011 02:23PM
September 05, 2011 12:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.