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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:47:17+00:00 2026-06-18T01:47:17+00:00

select start_date,stop_date_original from dates where start_date is not null and stop_date_original is not null

  • 0
select
start_date,stop_date_original
from dates
where 
start_date is not null
and stop_date_original is not null 
and start_date > str_to_date('10/10/2009','%d/%m/%Y')
/*and stop_date_original < str_to_date('01/24/2013','%d/%m/%Y')*/

this query works fine but when i uncomment the last line or use it to replace the one before the result doesnt get affected or i get an empty result set.

are there issues with this approach that might cause this behaviour?

also, are the null checks intrinsically necesarry across different database systems?

  • 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-18T01:47:19+00:00Added an answer on June 18, 2026 at 1:47 am

    Stop date has to be 24/01/2013, not 01/24/2013:

    select
      start_date,
      stop_date_original
    from
      dates
    where 
      start_date is not null
      and stop_date_original is not null 
      and start_date > str_to_date('10/10/2009','%d/%m/%Y')
      and stop_date_original < str_to_date('24/01/2013','%d/%m/%Y')
    

    or you have to invert day and month on your function str_to_date('01/24/2013','%m/%d/%Y').

    Also, if start_date is null, or if stop_date_original is null, the condition would be evaluated as null anyway so you don’t need to check if they are not null, although this make things more readable.

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

Sidebar

Related Questions

I want to make this sql query in doctrine: SELECT * FROM ( (SELECT
SELECT id as Id from dbTable WHERE code = ? AND CURDATE() BETWEEN start_date
Just see this: SELECT clientid,clientname,startdate,enddate,age FROM clients WHERE clientid IN (1,2,3,4,5) AND CASE WHEN
Please look the following query: SELECT ID, START, END FROM TABLEA the result is:
I'm stuck with a SQL Query. I have this table: [Reserve] ID NUMBER START_DATE,
I have this long sql query here.. SELECT c.clientid, c.clientname, c.billingdate, case when (select
This is similar to Compute dates and durations in mysql query , except that
i need update fields 'ErrCode' from select between 2 table. i try query it's
I have: remoteDB(); QSqlQuery query(SELECT * FROM products); int id = query.record().indexOf(id); int aa
I have the following MySQL-query: SELECT s.student_socialnr, s.student_lastname, s.student_firstname, cs.city_name, scp.cpl_startdate, scp.cpl_enddate, scp.cpl_invoice, cu.customer_name,

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.