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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:24:35+00:00 2026-05-14T15:24:35+00:00

I have an event in my database with a startDate and an endDate .

  • 0

I have an event in my database with a startDate and an endDate.

I need to display this event (based on the current date) on every day the event occurs.

So if the event starts on the 3rd of May and finishes on the 7th of May, the SQL query must find it on every single day.

How can I achieve this?

SELECT * FROM events WHERE startDate ???
  • 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-14T15:24:35+00:00Added an answer on May 14, 2026 at 3:24 pm

    Oh, try:

    SELECT * FROM events WHERE GetDate() BETWEEN startDate AND endDate

    Essentially, you’re telling the database to look up the current date (with the GetDate() function) and see if it lies between the start and end date of the given events!

    Just to elaborate a bit, one of the things I remember in school that got to me was the use of functions in queries. SQL has a lot of built in functions like GetDate() that you can use pretty much anywhere in your query: in the WHERE clause to compare against values in the given query, in the SELECT clause if you need to do something to data that you want to output, etc… don’t be afraid to use ’em! =)

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

Sidebar

Related Questions

I have a database with event information, including date (in MMDDYYYY format). is it
I have a database with event names and dates. I am trying to create
I have a database table of events. Each event has a category and a
I have a table in my postgresql 8.4 database like this: id(serial), event_type_id(id, foreign
I have button, which fires an event, that deletes a record from the database.
I have an events log database. I need to limit the size of SQL
I currently have event.stopPropagation() to work on a few selectors, but now I need
I have the following database structure: Event table Id - Guid (PK) Name -
I have a database with 3 key fields start_date end_date date start_date and end_date
I have a one to many relationship in my database where one event could

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.