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 6773291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:39:03+00:00 2026-05-26T15:39:03+00:00

I have an calendar event with StartDateTime and EndDateTime. These events are stored as

  • 0

I have an calendar event with StartDateTime and EndDateTime. These events are stored as records in database. I want to get all events for specific date. There are multiple scenarios that come to mind right away.

Given a specific date 12/01/2011, I want to get events which fall on 12/01/2011 (from 12:00:00 AM to 11:59:59 PM).

So I need to select:

  1. Events whose StartDateTime and EndDateTime falls into range of 12/01/2011 12:00:00 AM and 12/01/2011 11:59:00 PM

  2. Events that span onto next day. That is StartDateTime is on 12/01/2011 before 11:59:59 PM but EndDateTime is sometime in future

  3. Events whose EndDateTime is on 12/01/2011 but before 11:59:59 PM and whose StartDateTime is before 12/01/2011 12:00:00 AM

  4. Events that span multiple days. That is StartDateTime is before 12/01/2011 12:00:00 AM and EndDateTime is after 12/01/2011 11:59:59 PM

I might be missing other scenarios. I have a feeling this is not an original problem and there are methods out there that do exactly what I need. Is there a standard way to select these events?

  • 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-05-26T15:39:04+00:00Added an answer on May 26, 2026 at 3:39 pm

    I think your 4 cases break down to a single statement (pseudocode)

    if ((StartDate <= InputDate) && (EndDate >= InputDate))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of Calendar event information (Date, username). I want to print
I have a text box with event name and two calendar controls to get
I have calendar in Qt. I want when user selects date, 14(Qint32) will be
I have an event calendar with start and end date like this: 16.08.2010 12:00:00
I have set alarm for inserting calendar events. If more than one calendar event
I have a database table which records all field changes in all database tables
I have a calendar application and it loads all of the event data using
I have made event Calendar using EKEventKit, Now I want to add my iphone
i have an event calendar application with a sql database behind it and right
I want to create an event calendar application similar to the site http://events.stanford.edu/ using

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.