File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mysql query to check the date