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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:09:52+00:00 2026-06-04T06:09:52+00:00

with _range you can do a between query start_date = datetime.date(2005, 1, 1) end_date

  • 0

with _range you can do a between query

start_date = datetime.date(2005, 1, 1)
end_date = datetime.date(2005, 3, 31)
Entry.objects.filter(pub_date__range=(start_date, end_date))

You can use this if you have 2 dates and want to check if the date in het DB is between those 2 dates

In my case I have 1 date and want to check if that date is between my 2 date fields in db

class Deals(models.Model):
    #stuff
    starting = models.DateField()
    ending = models.Datefield()

How can I do a between query to check if month = '2010-01-01' is between starting and ending

Edit

I have deals in de Deals table. I want to know if there is a deal in January 2010(2010-01-01), February 2010(2010-02-01), etc

Like this

SELECT * FROM deals WHERE '2010-01-01' BETWEEN starting AND ending 
  • 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-04T06:09:53+00:00Added an answer on June 4, 2026 at 6:09 am
    Deals.objects.filter(starting__gte=mydate, ending__lte=mydate)
    

    Doc is here

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

Sidebar

Related Questions

We can use solr range query like: http://localhost:8983/solr/select?q=queryStr&fq=x:[10 TO 100] AND y:[20 TO 300]
I think I'm pretty close on this query, but can't seem to crack it,
I want to use a for loop to print every date between 2 dates.
Can Django admin site select entries by a custom date range, i.e. using two
I've been researching this problem for awhile now and I can't seem to come
I have a query that looks like this: select id , int1 , int2
While researching Oracle Analytics, I came across this query: select an_id, a_date, min(a_date) over
There was a previous question on StackOverflow about this subject (can insert the link,
Trying to figure out how to build a query in CakePHP where I can
I have a query that counts the price of all items between two dates.

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.