Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:39:56+00:00 2026-06-16T05:39:56+00:00

So im gonna try to explain this: I got datepicker where you select 2

  • 0

So im gonna try to explain this:

I got datepicker where you select 2 dates (start and end).

For example:
01-01-2012 till 11-12-2012

Now im gonna use these dates to search for jobs in a table:

startdate job: 10-10-2012
enddate job: 20-12-2012

I want to get that job as a result, because the job is running between those 2 dates.

I tried to use BETWEEN but that doesn’t seem to work for me. Can somebody help me with the query? Ofcourse i translate the date format to yyyy-mm-dd.

The point is that i want to show the job even if only 1 day is in the range of the datepicker date.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:39:57+00:00Added an answer on June 16, 2026 at 5:39 am

    You’re looking for the intersection of 2 date ranges. So given dateranges d1 and d2, you know that d2.start must occur before d1.end. You also know that d2.end must occur after d1.start. If both conditions are true, then you have overlap. In SQL:

    SELECT d.* 
    FROM thedates d
    WHERE d.jobstart < $myenddate
      AND d.jobend > $mystartdate
    

    ETA diagram for clarity:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm gonna try to explain at my best. I use Play Framework 2, and
first I'm gonna try to explain what exactly I want to do: I have
Gonna give an example since it's hard to understand what i'm talking about: SELECT
Ok guys I'm gonna do my best to explain this. I have a list
In the end this is gonna be a simple responsive slider. problems being the
I'm gonna try and simplify this as much as possible. Lets say i have
I'm gonna try to explain my problem : I'd like to allow users to
Hello sorry if this may be a stupid question, I am gonna try a
Im gonna try to explain what I need to do. I have a table
It's gonna be hard for me to explain the whole situation, but I'll try...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.