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?
Stop date has to be
24/01/2013, not01/24/2013:or you have to invert day and month on your function
str_to_date('01/24/2013','%m/%d/%Y').Also, if
start_dateis null, or ifstop_date_originalis 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.