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

  • SEARCH
  • Home
  • 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 7791803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:00:11+00:00 2026-06-01T22:00:11+00:00

I am trying to make a query with overlapping dates. My tabel look like

  • 0

I am trying to make a query with overlapping dates.
My tabel look like this’

Agenda ID   DateStart               DateEnd
-------------------------------------------------------
1           2012-04-02 08:00:00     2012-04-02 11:30:00
2           2012-04-02 10:00:00     2012-04-02 13:00:00
3           2012-04-02 12:00:00     2012-04-02 15:00:00

This data is for planning activities. You can’t plan a activity if the time overlaps.
In this case all the times overlap. But he compares it to the one you planned earlier.
Say I planned ID 1, so I can’t plan ID 2, But I can plan ID 3.

How Can I write A query with php to select the items that overlap.
Thank you very much

SELECT
   agenda.DateStart,
   agenda.DateEnd,
   agenda.AgendaID
FROM
   AGENDA
WHERE
   ????
   AND
   ????
  • 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-01T22:00:14+00:00Added an answer on June 1, 2026 at 10:00 pm
    select a.DateStart, a.DateEnd, a.AgendaId, b.DateStart, b.DateEnd, b.AgendaId
    from agenda a, agenda b
    where 
    a.AgendaId <> b.AgendaId
    and b.DateStart>= a.DateStart and
    b.DateStart<= a.DateEnd
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a query that would do something like this... id |
I'm trying to make a query, something like this: SELECT * FROM table WHERE
I am trying to make a search query like Youtube. http://www.youtube.com/results?search_query=new+york here is the
I'm trying to make a query where my LIKE can match any field in
I'm trying to make a query where I get data from two tables but
I'm trying to make this query work, in my model Workshop I have a
I've been trying to make this query work for the last couple of hours,
I am trying to make a query as usual but this time I need
I am trying to make this query work: SELECT Stock.*, StockFeatures.Features, StockDescriptions.Detailed, StockDescriptions.Technical, PRD1.RuleValue
Currently im trying to make my query short with reusable peice of code like

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.