This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes mysql query to check the date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql query to check the date" Watch "mysql query to check the date" New topic
Author

mysql query to check the date

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,
I am doing a program like phone booking.Now what i need is, a person who had booked a product already in last 15 days should not book another time within that 15 days.what is the mysql query to check whether he had booked already within last 15 days.

Thanks.
Dag Corell
Greenhorn

Joined: Sep 19, 2006
Posts: 3
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_datediff
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,
Thank you for your reply.
i want to check whether the systemdate and registered date is greater than 20.if yes i want to update the flag and registered date.if not ,it should go to else part.But my code does not goes to the else part even the condition is false.where am i wrong?my code follows:

please help me to find my error.

Thanks.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
I got the result. Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mysql query to check the date