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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:34:27+00:00 2026-05-26T21:34:27+00:00

select ‘2011-02-29’ BETWEEN ‘2011-02-01’ AND ‘2011-03-03’‎ this is returning 1. I think between doesn’t

  • 0
select '2011-02-29' BETWEEN '2011-02-01' AND '2011-03-03'‎

this is returning 1. I think between doesn’t consider leap year. I want your view on this?

[EDIT]
SELECT DATE( '2010-04-31' ) is returning NULL;
But select str_to_date('2010-04-31', '%Y-%m-%d') is retuning date.

Why?

Thanks
Venu

  • 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-26T21:34:27+00:00Added an answer on May 26, 2026 at 9:34 pm

    you need to cast it to date like:

    SELECT DATE('2011-02-29') BETWEEN DATE('2011-02-01') AND DATE('2011-03-03')
    

    from the site :

    For best results when using BETWEEN with date or time values, use
    CAST() to explicitly convert the values to the desired data type.
    Examples: If you compare a DATETIME to two DATE values, convert the
    DATE values to DATETIME values. If you use a string constant such as
    ‘2001-1-1’ in a comparison to a DATE, cast the string to a DATE.

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

Sidebar

Related Questions

select email from mailing list This is the query i want to use if
SELECT UNNEST(ARRAY[1,2,3,4]) While executing the above query I got the error like this: ERROR:
select count(*) as count from table group by foreign_id order by count This returns
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part:
SELECT User, COUNT(User) as count FROM Tests GROUP by User; This works. However, if
SELECT DISTINCT MonthName(Month([Date])) AS [Month], tblSupportCalls.System, Count(tblSupportCalls.System) AS [Total for System], Year([Date]) AS [Year]
select * from table where key='çmyk' when i run this query on table that
select count(category) from list where category like 'action' above is a query i want
select name, lat, lng from locations limit 10 What if I want a specific
SELECT * FROM CLIENT WHERE CLIENT_REG_DATE > DATEADD(year,-1,GETDATE()) GROUPBY MONTH(CLIENT_REG_DATE). I put into Apex

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.