wood burning stoves 2.0*
The moose likes JDBC and the fly likes My SQL Select Query Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "My SQL Select Query Help" Watch "My SQL Select Query Help" New topic
Author

My SQL Select Query Help

Kishen Singh Punjabi
Ranch Hand

Joined: Sep 14, 2012
Posts: 65
Help me in constructing a My Sql Query to retrieve the rows based on date time column.
Below are the conditions:
1)The date difference between today and date in that column should be =>2 days.
2)If the day of the date in DB column is Thursday/ Friday then the date difference between today and date in that column should be =>4 days.

Basically , I want all the rows that 2 days older considering 'Saturday & Sunday' as holidays.

Thanks in Advance
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Have you had any ideas yet?
Here in java ranch our aim is to help you towards your own solution, as we feel that way you learn an awful lot more.

But i will give you one clue there is a date function called datediff which gives you the number of days between two dates ignoring any time bits.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My SQL Select Query Help
 
Similar Threads
calculate duration between two dates
Exception:com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: W
sum funtion based on sytem dates
Perforarmance diff bet hibernate and JDBC
Combining fields from 2 resultsets in 1 vector