Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My SQL Select Query Help

 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic